diff --git a/colab/GPU.ipynb b/colab/GPU.ipynb index bd96290f7..e9bb3ddd8 100644 --- a/colab/GPU.ipynb +++ b/colab/GPU.ipynb @@ -31,8 +31,8 @@ "TavernAI Boosty https://boosty.to/tavernai\n", "
\n",
         " Tavern.AI/ \\ /  ^   ^ ^ ^    ~~~~ ^ \\     /  ^ ^   ^ ^/ ^  ^ \\/^  ^    \\\n",
-        "         /^ ^\\ ^ ^^ ^^  ^ ^  ~~   ^  ^\\   /  ^  ^ ^ ^ / ^ ^  ^/   ^ ^    \\\n",
-        "        /^ ^ ^\\^  ^^ ^ ^   _||____   ^ \\ /  ^  ^ ^   /       /  ^  ^  ^   \\\n",
+        "         /^ ^\\ ^  ^ ^   ^ ^  ~~   ^   \\   /  ^  ^ ^   / ^ ^  ^/   ^ ^    \\\n",
+        "        /^ ^ ^\\^   ^ ^ ^   _||____   ^ \\ /  ^  ^ ^   /       /  ^  ^  ^   \\\n",
         " /\\ /\\ /\\   ^  \\  /\\ /\\   /\\\\\\\\\\\\\\\\   ^ \\  ^ /\\ /\\ /\\   /\\ /\\ /\\  ^ ^  ^/\\\n",
         "//\\\\/\\\\/\\\\   ^  \\//\\\\/\\\\ /__\\\\\\\\\\\\\\\\  _, \\  //\\\\/\\\\/\\\\ //\\\\/\\\\/\\\\  ^ ^ //\\\\\n",
         "//\\\\/\\\\/\\\\       //\\\\/\\\\ |__|_|_|__|   \\__, //\\\\/\\\\/\\\\ //\\\\/\\\\/\\\\     ///\\\\\\\n",
@@ -42,9 +42,10 @@
         "**Launch Instructions**
\n", "1. Click the launch button.\n", "2. Wait for the environment and model to load\n", - "3. After initialization, a TavernAI link will appear", - "\n**Faq**
", - "* Q: I do not get a TavernAI link", + "3. After initialization, a TavernAI link will appear\n", + "\n", + "**Faq**
\n", + "* Q: I do not get a TavernAI link\n", "* A: It seems the localtunnel service is currently down, so the TavernAI link is unavailable. Need to wait for it to become available again." ], "metadata": { @@ -66,7 +67,7 @@ "Model = \"Pygmalion 6B\" #@param [ \"Pygmalion 6B\", \"Pygmalion 6B Dev\"] {allow-input: true}\n", "Version = \"Official\" \n", "Provider = \"Cloudflare\" \n", - "use_google_drive = False\n", + "use_google_drive = False #@param {type:\"boolean\"}\n", "\n", "!nvidia-smi\n", "import subprocess\n", @@ -74,8 +75,32 @@ "import sys\n", "import os\n", "from google.colab import drive\n", + "def sync_files():\n", + " while True:\n", + " source_files = os.listdir(\"/taicolabtest/public/chats/\")\n", + " destination_files = os.listdir(\"/content/drive/MyDrive/TavernAI/chats\")\n", + "\n", + " new_files = set(source_files) - set(destination_files)\n", + " deleted_files = set(destination_files) - set(source_files)\n", + "\n", + " if new_files:\n", + " for file in new_files:\n", + " !cp /taicolabtest/public/chats/{file} /content/drive/MyDrive/TavernAI/chats\n", + "\n", + " if deleted_files:\n", + " for file in deleted_files:\n", + " !rm /content/drive/MyDrive/TavernAI/chats/{file}\n", + "\n", + " time.sleep(3) # Wait for 60 seconds before checking for changes again\n", + "\n", "if use_google_drive:\n", " drive.mount('/content/drive/')\n", + " if not os.path.exists(\"/content/drive/MyDrive/TavernAI/\"):\n", + " os.mkdir(\"/content/drive/MyDrive/TavernAI/\")\n", + " if not os.path.exists(\"/content/drive/MyDrive/TavernAI/characters/\"):\n", + " os.mkdir(\"/content/drive/MyDrive/TavernAI/characters/\")\n", + " if not os.path.exists(\"/content/drive/MyDrive/TavernAI/chats/\"):\n", + " os.mkdir(\"/content/drive/MyDrive/TavernAI/chats/\")\n", "else:\n", " if not os.path.exists(\"/content/drive\"):\n", " os.mkdir(\"/content/drive\")\n", @@ -140,6 +165,7 @@ "%env colaburl=$url\n", "!nohup node server.js &\n", "time.sleep(3)\n", + "\n", "print('KoboldAI LINK:')\n", "print(url)\n", "print('')\n",