mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-03-06 12:27:42 +01:00
Allow model on Drive
Initial commit for extracted model support experimenting
This commit is contained in:
parent
3f88b4f840
commit
e790a4f9be
@ -2,7 +2,7 @@
|
|||||||
# KoboldAI Easy Deployment Script by Henk717
|
# KoboldAI Easy Deployment Script by Henk717
|
||||||
|
|
||||||
# read the options
|
# read the options
|
||||||
TEMP=`getopt -o m:i:p:c:d:a:l:z:g:t:n: --long model:,init:,path:,configname:,download:,aria2:,dloc:7z:git:tar:ngrok: -- "$@"`
|
TEMP=`getopt -o m:i:p:c:d:x:a:l:z:g:t:n: --long model:,init:,path:,configname:,download:,aria2:,dloc:xloc:7z:git:tar:ngrok: -- "$@"`
|
||||||
eval set -- "$TEMP"
|
eval set -- "$TEMP"
|
||||||
|
|
||||||
# extract options and their arguments into variables.
|
# extract options and their arguments into variables.
|
||||||
@ -13,7 +13,7 @@ while true ; do
|
|||||||
-i|--init)
|
-i|--init)
|
||||||
init=$2 ; shift 2 ;;
|
init=$2 ; shift 2 ;;
|
||||||
-p|--path)
|
-p|--path)
|
||||||
path=" --path /content/$2" ; shift 2 ;;
|
path=" --path $2" ; shift 2 ;;
|
||||||
-c|--configname)
|
-c|--configname)
|
||||||
configname=" --configname $2" ; shift 2 ;;
|
configname=" --configname $2" ; shift 2 ;;
|
||||||
-n|--ngrok)
|
-n|--ngrok)
|
||||||
@ -24,6 +24,8 @@ while true ; do
|
|||||||
aria2="$2" ; shift 2 ;;
|
aria2="$2" ; shift 2 ;;
|
||||||
-l|--dloc)
|
-l|--dloc)
|
||||||
dloc="$2" ; shift 2 ;;
|
dloc="$2" ; shift 2 ;;
|
||||||
|
-x|--xloc)
|
||||||
|
dloc="$2" ; shift 2 ;;
|
||||||
-z|--7z)
|
-z|--7z)
|
||||||
z7="$2" ; shift 2 ;;
|
z7="$2" ; shift 2 ;;
|
||||||
-t|--tar)
|
-t|--tar)
|
||||||
@ -64,6 +66,16 @@ else
|
|||||||
dloc="/content/drive/MyDrive/KoboldAI/models"
|
dloc="/content/drive/MyDrive/KoboldAI/models"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Redefine the extraction location
|
||||||
|
if [ "$xloc" == "drive" ]; then
|
||||||
|
xloc="/content/drive/MyDrive/KoboldAI/models/"
|
||||||
|
else
|
||||||
|
xloc="/content/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Redefine the Path to be in the relevant location
|
||||||
|
path = $xloc$path
|
||||||
|
|
||||||
# Create Folder Structure and Install KoboldAI
|
# Create Folder Structure and Install KoboldAI
|
||||||
if [ "$init" != "skip" ]; then
|
if [ "$init" != "skip" ]; then
|
||||||
if [ -f "/content/installed" ]; then
|
if [ -f "/content/installed" ]; then
|
||||||
@ -135,7 +147,7 @@ fi
|
|||||||
|
|
||||||
#Extract the model with 7z
|
#Extract the model with 7z
|
||||||
if [ ! -z ${z7+x} ]; then
|
if [ ! -z ${z7+x} ]; then
|
||||||
7z x -o/content/ -aos $dloc/$z7
|
7z x -o$xloc -aos $dloc/$z7
|
||||||
touch /content/extracted
|
touch /content/extracted
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -148,7 +160,7 @@ if [ ! -z ${tar+x} ]; then
|
|||||||
make install
|
make install
|
||||||
cd ..
|
cd ..
|
||||||
apt install zstd -y
|
apt install zstd -y
|
||||||
pv $dloc/$tar | tar -I zstd -C /content/ -x
|
pv $dloc/$tar | tar -I zstd -C $xloc -x
|
||||||
touch /content/extracted
|
touch /content/extracted
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user