mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
fix tab vs space error
This commit is contained in:
18
aiserver.py
18
aiserver.py
@@ -7475,16 +7475,16 @@ def loadRequest(loadpath, filename=None):
|
||||
start_time = time.time()
|
||||
if(isinstance(loadpath, str)):
|
||||
#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 isinstance(loadpath, dict) and not os.path.exists(loadpath):
|
||||
if os.path.exists(loadpath.replace(".json", "")):
|
||||
loadpath = loadpath.replace(".json", "")
|
||||
if not isinstance(loadpath, dict) and not os.path.exists(loadpath):
|
||||
if os.path.exists(loadpath.replace(".json", "")):
|
||||
loadpath = loadpath.replace(".json", "")
|
||||
|
||||
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)
|
||||
loadpath = os.path.join(loadpath, "story.json")
|
||||
|
||||
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)
|
||||
loadpath = os.path.join(loadpath, "story.json")
|
||||
|
||||
with open(loadpath, "r", encoding="utf-8") as file:
|
||||
js = json.load(file)
|
||||
from_file=loadpath
|
||||
|
Reference in New Issue
Block a user