updated colab (+1 squashed commits)

Squashed commits:

[d42c3848] update colab (+2 squashed commit)

Squashed commit:

[213b1d00] Revert "temporarily disable image gen on colab"

This reverts commit f44df0e251.

[af4e9803] Revert "remove for now"

This reverts commit 5174f9de7b.
This commit is contained in:
Concedo 2024-03-08 18:53:50 +08:00
parent 2132bf9ca0
commit 308f33fc00

View file

@ -52,6 +52,9 @@
"Layers = 99 #@param [99]{allow-input: true}\r\n",
"ContextSize = 4096 #@param [4096] {allow-input: true}\r\n",
"ForceRebuild = False #@param {type:\"boolean\"}\r\n",
"LoadImgModel = False #@param {type:\"boolean\"}\r\n",
"ImgModel = \"https://huggingface.co/koboldcpp/imgmodel/resolve/main/imgmodel_older_q4_0.gguf\" #@param [\"https://huggingface.co/koboldcpp/imgmodel/resolve/main/imgmodel_older_q4_0.gguf\"]{allow-input: true}\r\n",
"SCommand = \"\"\r\n",
"\r\n",
"import os\r\n",
"if not os.path.isfile(\"/opt/bin/nvidia-smi\"):\r\n",
@ -64,6 +67,10 @@
"kvers = kvers[0]\r\n",
"if ForceRebuild:\r\n",
" kvers = \"force_rebuild\"\r\n",
"if ImgModel and LoadImgModel:\r\n",
" SCommand = \"--sdconfig imodel.gguf clamped 4 quant\"\r\n",
"else:\r\n",
" SCommand = \"\"\r\n",
"!echo Finding prebuilt binary for {kvers}\r\n",
"!wget -O dlfile.tmp https://kcppcolab.concedo.workers.dev/?{kvers} && mv dlfile.tmp koboldcpp_cublas.so\r\n",
"!test -f koboldcpp_cublas.so && echo Prebuilt Binary Exists || echo Prebuilt Binary Does Not Exist\r\n",
@ -72,7 +79,9 @@
"!apt update\r\n",
"!apt install aria2 -y\r\n",
"!aria2c -x 10 -o model.gguf --summary-interval=5 --download-result=default --allow-overwrite=true --file-allocation=none $Model\r\n",
"!python koboldcpp.py model.gguf --usecublas 0 mmq --multiuser --gpulayers $Layers --contextsize $ContextSize --quiet --remotetunnel\r\n"
"if SCommand:\r\n",
" !aria2c -x 10 -o imodel.gguf --summary-interval=5 --download-result=default --allow-overwrite=true --file-allocation=none $ImgModel\r\n",
"!python koboldcpp.py model.gguf --usecublas 0 mmq --multiuser --gpulayers $Layers --contextsize $ContextSize --quiet --remotetunnel $SCommand\r\n"
]
}
],