From a34ce85d21ac750b6a0b69a3e33ff24e9179a224 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 16 Apr 2023 20:43:03 -0400 Subject: [PATCH] Fix for UI1 remote mode file loading from browser --- aiserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiserver.py b/aiserver.py index b8ff4f3e..9dd621ef 100644 --- a/aiserver.py +++ b/aiserver.py @@ -7454,13 +7454,13 @@ def loadRequest(loadpath, filename=None): if not loadpath: return - + #Original UI only sends the story name and assumes it's always a .json file... here we check to see if it's a directory to load that way - if not os.path.exists(loadpath): + if not isinstance(loadpath, dict) and not os.path.exists(loadpath): if os.path.exists(loadpath.replace(".json", "")): loadpath = loadpath.replace(".json", "") - if os.path.isdir(loadpath): + if not isinstance(loadpath, dict) and os.path.isdir(loadpath): if not valid_v3_story(loadpath): raise RuntimeError(f"Tried to load {loadpath}, a non-save directory.") koboldai_vars.update_story_path_structure(loadpath)