diff --git a/aiserver.py b/aiserver.py index 9dd4f530..dfde38be 100644 --- a/aiserver.py +++ b/aiserver.py @@ -393,7 +393,7 @@ def get_message(msg): vars.formatoptns["frmtadsnsp"] = msg['data'] settingschanged() elif(msg['cmd'] == 'importselect'): - vars.importnum = int(msg["data"][-1]) + vars.importnum = int(msg["data"].replace("import", "")) elif(msg['cmd'] == 'importcancel'): emit('from_server', {'cmd': 'popupshow', 'data': False}) vars.importjs = {} @@ -1208,7 +1208,7 @@ def importRequest(): exitModes() # Read file contents into JSON object - file = open(importpath, "r") + file = open(importpath, "rb") vars.importjs = json.load(file) # Clear Popup Contents @@ -1222,8 +1222,11 @@ def importRequest(): for story in vars.importjs: ob = {} ob["num"] = num - ob["title"] = story["title"] - if(story["description"] != ""): + if(story["title"] != "" and story["title"] != None): + ob["title"] = story["title"] + else: + ob["title"] = "(No Title)" + if(story["description"] != "" and story["description"] != None): ob["descr"] = story["description"] else: ob["descr"] = "(No Description)" @@ -1259,16 +1262,17 @@ def importgame(): vars.actions.append(act["text"]) # Get just the important parts of world info - if(len(ref["worldInfo"]) > 1): - num = 0 - for wi in ref["worldInfo"]: - vars.worldinfo.append({ - "key": wi["keys"], - "content": wi["entry"], - "num": num, - "init": True - }) - num += 1 + if(ref["worldInfo"] != None): + if(len(ref["worldInfo"]) > 1): + num = 0 + for wi in ref["worldInfo"]: + vars.worldinfo.append({ + "key": wi["keys"], + "content": wi["entry"], + "num": num, + "init": True + }) + num += 1 # Clear import data vars.importjs = {} diff --git a/readme.txt b/readme.txt index c45a9b06..fd1ae916 100644 --- a/readme.txt +++ b/readme.txt @@ -22,9 +22,10 @@ to 40,000 characters, and the free account will work with KoboldAI. [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) -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.) 3. Run install_requirements.bat. (This will install the necessary python packages via pip) @@ -71,4 +72,11 @@ Save the JSON file to your computer using the prompt. Run KoboldAI, and after connecting to the web GUI, press the Import button at the top. 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. -Select an Adventure and click the Accept button. \ No newline at end of file +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 \ No newline at end of file diff --git a/static/custom.css b/static/custom.css index 73e3392d..567522b4 100644 --- a/static/custom.css +++ b/static/custom.css @@ -177,7 +177,7 @@ chunk { } #popupcontent { - min-height: 300px; + height: 325px; overflow-y: scroll; }