Model = "PPO_Pygway-V8p4_Dev-6b" #@param ["PPO_Pygway-V8p4_Dev-6b", "Dolly_Shygmalion-6b"] {allow-input: true}
Version = "Official"
KoboldAI_Provider = "Localtunnel" #@param ["Localtunnel", "Cloudflare"]
use_google_drive = True #@param {type:"boolean"}
Provider = KoboldAI_Provider
!nvidia-smi
import subprocess
import time
import sys
import os
import threading
import shutil
from google.colab import drive
if use_google_drive:
drive.mount('/content/drive/')
if not os.path.exists("/content/drive/MyDrive/TavernAI/"):
os.mkdir("/content/drive/MyDrive/TavernAI/")
if not os.path.exists("/content/drive/MyDrive/TavernAI/characters/"):
os.mkdir("/content/drive/MyDrive/TavernAI/characters/")
if not os.path.exists("/content/drive/MyDrive/TavernAI/chats/"):
os.mkdir("/content/drive/MyDrive/TavernAI/chats/")
else:
if not os.path.exists("/content/drive"):
os.mkdir("/content/drive")
if not os.path.exists("/content/drive/MyDrive/"):
os.mkdir("/content/drive/MyDrive/")
def copy_characters(use_google_drive=False):
if not use_google_drive:
return
#Henk's KoboldAI script
!wget https://koboldai.org/ckds && chmod +x ckds
!./ckds --init only
if Provider == "Localtunnel":
p = subprocess.Popen(['/content/ckds', '--model', Model, '--localtunnel', 'yes'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else:
p = subprocess.Popen(['/content/ckds', '--model', Model], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
#Do not repeat! Tricks performed by a professional!
url = ''
while True:
line = p.stdout.readline().decode().strip()
if "KoboldAI has finished loading and is available at the following link: " in line:
print(line)
url = line.split("KoboldAI has finished loading and is available at the following link: ")[1]
print(url)
break
if "KoboldAI has finished loading and is available at the following link for UI 1: " in line:
print(line)
url = line.split("KoboldAI has finished loading and is available at the following link for UI 1: ")[1]
print(url)
break
if not line:
break
print(line)
if "INIT" in line and "Transformers" in line:
print("Model loading... (It will take 2 - 5 minutes)")