mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix for UI1 remote mode file loading from browser
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user