From 308f33fc002c9f47e6af8d00fe34cabaf4e32565 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 8 Mar 2024 18:53:50 +0800 Subject: [PATCH] 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 f44df0e251b5a5e20c0ed93e2465e7a73c9800d8. [af4e9803] Revert "remove for now" This reverts commit 5174f9de7b9d30dc12174a865c0cef612658f5aa. --- colab.ipynb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/colab.ipynb b/colab.ipynb index bc9c66fbc..32db3d630 100644 --- a/colab.ipynb +++ b/colab.ipynb @@ -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" ] } ],