Bug fixes for AIDCAT import issues.

Modified CSS to prevent Import dialog from expanding off the page.
Updated readme with Colab link.
This commit is contained in:
KoboldAI Dev 2021-05-14 16:27:47 -04:00
parent 5d53f1a676
commit 429c9b13f5
3 changed files with 30 additions and 18 deletions

View File

@ -393,7 +393,7 @@ def get_message(msg):
vars.formatoptns["frmtadsnsp"] = msg['data'] vars.formatoptns["frmtadsnsp"] = msg['data']
settingschanged() settingschanged()
elif(msg['cmd'] == 'importselect'): elif(msg['cmd'] == 'importselect'):
vars.importnum = int(msg["data"][-1]) vars.importnum = int(msg["data"].replace("import", ""))
elif(msg['cmd'] == 'importcancel'): elif(msg['cmd'] == 'importcancel'):
emit('from_server', {'cmd': 'popupshow', 'data': False}) emit('from_server', {'cmd': 'popupshow', 'data': False})
vars.importjs = {} vars.importjs = {}
@ -1208,7 +1208,7 @@ def importRequest():
exitModes() exitModes()
# Read file contents into JSON object # Read file contents into JSON object
file = open(importpath, "r") file = open(importpath, "rb")
vars.importjs = json.load(file) vars.importjs = json.load(file)
# Clear Popup Contents # Clear Popup Contents
@ -1222,8 +1222,11 @@ def importRequest():
for story in vars.importjs: for story in vars.importjs:
ob = {} ob = {}
ob["num"] = num ob["num"] = num
ob["title"] = story["title"] if(story["title"] != "" and story["title"] != None):
if(story["description"] != ""): ob["title"] = story["title"]
else:
ob["title"] = "(No Title)"
if(story["description"] != "" and story["description"] != None):
ob["descr"] = story["description"] ob["descr"] = story["description"]
else: else:
ob["descr"] = "(No Description)" ob["descr"] = "(No Description)"
@ -1259,16 +1262,17 @@ def importgame():
vars.actions.append(act["text"]) vars.actions.append(act["text"])
# Get just the important parts of world info # Get just the important parts of world info
if(len(ref["worldInfo"]) > 1): if(ref["worldInfo"] != None):
num = 0 if(len(ref["worldInfo"]) > 1):
for wi in ref["worldInfo"]: num = 0
vars.worldinfo.append({ for wi in ref["worldInfo"]:
"key": wi["keys"], vars.worldinfo.append({
"content": wi["entry"], "key": wi["keys"],
"num": num, "content": wi["entry"],
"init": True "num": num,
}) "init": True
num += 1 })
num += 1
# Clear import data # Clear import data
vars.importjs = {} vars.importjs = {}

View File

@ -22,9 +22,10 @@ to 40,000 characters, and the free account will work with KoboldAI.
[SETUP] [SETUP]
1. Install Python. (https://www.python.org/downloads/) 1. Install a 64-bit version of Python.
(Development was done on 3.7, I have not tested newer versions) (Development was done on 3.7, I have not tested newer versions)
2. When installing Python make sure "pip" is selected under Optional features. Windows download link: https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe
2. When installing Python make sure "Add Python to PATH" is selected.
(If pip isn't working, run the installer again and choose Modify to choose Optional features.) (If pip isn't working, run the installer again and choose Modify to choose Optional features.)
3. Run install_requirements.bat. 3. Run install_requirements.bat.
(This will install the necessary python packages via pip) (This will install the necessary python packages via pip)
@ -72,3 +73,10 @@ Run KoboldAI, and after connecting to the web GUI, press the Import button at th
Navigate to the JSON file exported from AIDCAT and select it. A prompt will appear in the GUI Navigate to the JSON file exported from AIDCAT and select it. A prompt will appear in the GUI
presenting you with all Adventures scraped from your AI Dungeon account. presenting you with all Adventures scraped from your AI Dungeon account.
Select an Adventure and click the Accept button. Select an Adventure and click the Accept button.
[HOST GPT-NEO ON GOOGLE COLAB]
If your computer does not have an 8GB GPU to run GPT-Neo locally, you can now run a Google Colab
notebook hosting a GPT-Neo-2.7B model remotely and connect to it using the KoboldAI client.
See the instructions on the Colab at the link below:
https://colab.research.google.com/drive/1uGe9f4ruIQog3RLxfUsoThakvLpHjIkX?usp=sharing

View File

@ -177,7 +177,7 @@ chunk {
} }
#popupcontent { #popupcontent {
min-height: 300px; height: 325px;
overflow-y: scroll; overflow-y: scroll;
} }