mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add extras to colab
This commit is contained in:
@ -55,8 +55,8 @@
|
|||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "hps3qtPLFNBb",
|
"cellView": "form",
|
||||||
"cellView": "form"
|
"id": "hps3qtPLFNBb"
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -67,6 +67,7 @@
|
|||||||
"Version = \"Official\" \n",
|
"Version = \"Official\" \n",
|
||||||
"KoboldAI_Provider = \"Localtunnel\" #@param [\"Localtunnel\", \"Cloudflare\"]\n",
|
"KoboldAI_Provider = \"Localtunnel\" #@param [\"Localtunnel\", \"Cloudflare\"]\n",
|
||||||
"use_google_drive = True #@param {type:\"boolean\"}\n",
|
"use_google_drive = True #@param {type:\"boolean\"}\n",
|
||||||
|
"extras_enable_captioning = False #@param {type:\"boolean\"}\n",
|
||||||
"Provider = KoboldAI_Provider\n",
|
"Provider = KoboldAI_Provider\n",
|
||||||
"!nvidia-smi\n",
|
"!nvidia-smi\n",
|
||||||
"import subprocess\n",
|
"import subprocess\n",
|
||||||
@ -159,6 +160,37 @@
|
|||||||
" if \"INIT\" in line and \"Transformers\" in line:\n",
|
" if \"INIT\" in line and \"Transformers\" in line:\n",
|
||||||
" print(\"Model loading... (It will take 2 - 5 minutes)\")\n",
|
" print(\"Model loading... (It will take 2 - 5 minutes)\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"ShareParam = \"--share\" if Provider == \"Cloudflare\" else \"\"\n",
|
||||||
|
"ExtrasModules = []\n",
|
||||||
|
"\n",
|
||||||
|
"if (extras_enable_captioning):\n",
|
||||||
|
" ExtrasModules.append('caption')\n",
|
||||||
|
"\n",
|
||||||
|
"ModulesParam = f'--enable-modules={\",\".join(ExtrasModules)}'\n",
|
||||||
|
"\n",
|
||||||
|
"#TavernAI extras\n",
|
||||||
|
"%cd /\n",
|
||||||
|
"!git clone https://github.com/SillyLossy/TavernAI-extras\n",
|
||||||
|
"%cd TavernAI-extras\n",
|
||||||
|
"!pip install -r requirements.txt\n",
|
||||||
|
"extras_process = subprocess.Popen(['python', 'server.py', '--cpu', ShareParam], stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n",
|
||||||
|
"\n",
|
||||||
|
"while True:\n",
|
||||||
|
" line = p.stdout.readline().decode().strip()\n",
|
||||||
|
" if \"Running on \" in line and Provider != \"Cloudflare\":\n",
|
||||||
|
" print(\"TavernAI Extras URL:\")\n",
|
||||||
|
" !lt --port 5100\n",
|
||||||
|
" print('')\n",
|
||||||
|
" break\n",
|
||||||
|
" if \"Running on \" in line and Provider == \"Cloudflare\" and \"trycloudflare.com\" in line:\n",
|
||||||
|
" print(\"TavernAI Extras URL:\")\n",
|
||||||
|
" extras_url = line.split(\"Running on \")[1]\n",
|
||||||
|
" print(extras_url)\n",
|
||||||
|
" print('')\n",
|
||||||
|
" break\n",
|
||||||
|
" if not line:\n",
|
||||||
|
" break\n",
|
||||||
|
" print(line)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"#TavernAI\n",
|
"#TavernAI\n",
|
||||||
"%cd /\n",
|
"%cd /\n",
|
||||||
@ -166,7 +198,7 @@
|
|||||||
"!nvm install 19.1.0\n",
|
"!nvm install 19.1.0\n",
|
||||||
"!nvm use 19.1.0\n",
|
"!nvm use 19.1.0\n",
|
||||||
"!node -v\n",
|
"!node -v\n",
|
||||||
"!git clone https://github.com/TavernAI/TavernAIColab\n",
|
"!git clone -b dev https://github.com/SillyLossy/TavernAI\n",
|
||||||
"copy_characters(use_google_drive)\n",
|
"copy_characters(use_google_drive)\n",
|
||||||
"%cd TavernAIColab\n",
|
"%cd TavernAIColab\n",
|
||||||
"!npm install\n",
|
"!npm install\n",
|
||||||
@ -186,6 +218,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"accelerator": "GPU",
|
||||||
"colab": {
|
"colab": {
|
||||||
"provenance": []
|
"provenance": []
|
||||||
},
|
},
|
||||||
@ -196,8 +229,7 @@
|
|||||||
},
|
},
|
||||||
"language_info": {
|
"language_info": {
|
||||||
"name": "python"
|
"name": "python"
|
||||||
},
|
}
|
||||||
"accelerator": "GPU"
|
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
"nbformat_minor": 0
|
"nbformat_minor": 0
|
||||||
|
Reference in New Issue
Block a user