Merge branch 'united' into patch

This commit is contained in:
Gnome Ann 2022-01-12 19:50:01 -05:00
commit f0b5cc137f
2 changed files with 35 additions and 11 deletions

View File

@ -68,8 +68,8 @@ modellist = [
["Lit 6B (NSFW)", "hakurei/lit-6B", "12GB"],
["C1 6B (Chatbot)", "hakurei/c1-6B", "12GB"],
["Picard 2.7B (Novel)", "KoboldAI/GPT-Neo-2.7B-Picard", "6GB"],
["Horni (NSFW)", "KoboldAI/GPT-Neo-2.7B-Horni", "6GB"],
["Horni-LN (Novel/NSFW)", "KoboldAI/GPT-Neo-2.7B-Horni-LN", "6GB"],
["Horni 2.7B (NSFW)", "KoboldAI/GPT-Neo-2.7B-Horni", "6GB"],
["Horni-LN 2.7B (Novel/NSFW)", "KoboldAI/GPT-Neo-2.7B-Horni-LN", "6GB"],
["Shinen 2.7B (NSFW)", "KoboldAI/GPT-Neo-2.7B-Shinen", "6GB"],
["GPT-J 6B", "EleutherAI/gpt-j-6B", "12GB"],
["GPT-Neo 2.7B", "EleutherAI/gpt-neo-2.7B", "6GB"],
@ -80,7 +80,7 @@ modellist = [
["GPT-2", "gpt2", "1GB"],
["OpenAI API (requires API key)", "OAI", ""],
["InferKit API (requires API key)", "InferKit", ""],
["Google Colab", "Colab", ""],
["KoboldAI Server API (Old Google Colab)", "Colab", ""],
["Read Only (No AI)", "ReadOnly", ""]
]
@ -616,7 +616,8 @@ if(vars.model == "OAI"):
# Ask for ngrok url if Google Colab was selected
if(vars.model == "Colab"):
if(vars.colaburl == ""):
print("{0}Please enter the ngrok.io or trycloudflare.com URL displayed in Google Colab:{1}\n".format(colors.CYAN, colors.END))
print("{0}NOTE: For the modern KoboldAI Colab's you open the links directly in your browser.\nThis option is only for the KoboldAI Server API, not all features are supported in this mode.\n".format(colors.YELLOW, colors.END))
print("{0}Enter the URL of the server (For example a trycloudflare link):{1}\n".format(colors.CYAN, colors.END))
vars.colaburl = input("URL> ") + "/request"
if(vars.model == "ReadOnly"):
@ -1719,7 +1720,7 @@ def get_message(msg):
raise ValueError("Chatname must be a string")
vars.chatname = msg['chatname']
settingschanged()
emit('from_server', {'cmd': 'setchatname', 'data': vars.chatname}, broadcast=True)
emit('from_server', {'cmd': 'setchatname', 'data': vars.chatname})
vars.recentrng = vars.recentrngm = None
actionsubmit(msg['data'], actionmode=msg['actionmode'])
elif(vars.mode == "edit"):
@ -1738,7 +1739,7 @@ def get_message(msg):
raise ValueError("Chatname must be a string")
vars.chatname = msg['chatname']
settingschanged()
emit('from_server', {'cmd': 'setchatname', 'data': vars.chatname}, broadcast=True)
emit('from_server', {'cmd': 'setchatname', 'data': vars.chatname})
actionretry(msg['data'])
# Back/Undo Action
elif(msg['cmd'] == 'back'):

View File

@ -2,7 +2,7 @@
# KoboldAI Easy Deployment Script by Henk717
# 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"
# extract options and their arguments into variables.
@ -13,7 +13,7 @@ while true ; do
-i|--init)
init=$2 ; shift 2 ;;
-p|--path)
path=" --path /content/$2" ; shift 2 ;;
mpath="$2" ; shift 2 ;;
-c|--configname)
configname=" --configname $2" ; shift 2 ;;
-n|--ngrok)
@ -24,6 +24,8 @@ while true ; do
aria2="$2" ; shift 2 ;;
-l|--dloc)
dloc="$2" ; shift 2 ;;
-x|--xloc)
xloc="$2" ; shift 2 ;;
-z|--7z)
z7="$2" ; shift 2 ;;
-t|--tar)
@ -44,7 +46,8 @@ function launch
exit 0
else
cd /content/KoboldAI-Client
python3 aiserver.py$model$path$configname$ngrok --remote --override_delete --override_rename
echo "Launching KoboldAI with the following options : python3 aiserver.py$model$kmpath$configname$ngrok --remote --override_delete --override_rename"
python3 aiserver.py$model$kmpath$configname$ngrok --remote --override_delete --override_rename
exit
fi
}
@ -64,6 +67,20 @@ else
dloc="/content/drive/MyDrive/KoboldAI/models"
fi
# Redefine the extraction location
if [ "$xloc" == "drive" ]; then
xloc="/content/drive/MyDrive/KoboldAI/models/"
dloc="/content"
else
xloc="/content/"
fi
# Redefine the Path to be in the relevant location
if [[ -v mpath ]];then
mpath="$xloc$mpath"
kmpath=" --path $mpath"
fi
# Create Folder Structure and Install KoboldAI
if [ "$init" != "skip" ]; then
if [ -f "/content/installed" ]; then
@ -122,6 +139,12 @@ if [ -f "/content/extracted" ]; then
launch
fi
# Is the model extracted on Google Drive? Skip the download and extraction
# Only on Google Drive since it has a big impact there if we don't, and locally we have better checks in place
if [ "$xloc" == "/content/drive/MyDrive/KoboldAI/models/" ] && [[ -d $mpath ]];then
launch
fi
#Download routine for regular Downloads
if [ ! -z ${download+x} ]; then
wget -c $download -P $dloc
@ -135,7 +158,7 @@ fi
#Extract the model with 7z
if [ ! -z ${z7+x} ]; then
7z x -o/content/ -aos $dloc/$z7
7z x -o$xloc $dloc/$z7 -aos
touch /content/extracted
fi
@ -148,7 +171,7 @@ if [ ! -z ${tar+x} ]; then
make install
cd ..
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
fi