Skip to content

Commit 6fa50f7

Browse files
committed
allow kcppt for config switching
1 parent 15ae98c commit 6fa50f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

koboldcpp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,7 @@ def do_GET(self):
24082408
opts = []
24092409
if args.admin and args.admindir and os.path.exists(args.admindir) and self.check_header_password(args.adminpassword):
24102410
dirpath = os.path.abspath(args.admindir)
2411-
opts = [f for f in sorted(os.listdir(dirpath)) if f.endswith(".kcpps") and os.path.isfile(os.path.join(dirpath, f))]
2411+
opts = [f for f in sorted(os.listdir(dirpath)) if (f.endswith(".kcpps") or f.endswith(".kcppt")) and os.path.isfile(os.path.join(dirpath, f))]
24122412
response_body = (json.dumps(opts).encode())
24132413

24142414
elif self.path.endswith(('/api/extra/perf')):
@@ -2780,7 +2780,7 @@ def do_POST(self):
27802780
if targetfile and targetfile!="":
27812781
dirpath = os.path.abspath(args.admindir)
27822782
targetfilepath = os.path.join(dirpath, targetfile)
2783-
opts = [f for f in os.listdir(dirpath) if f.endswith(".kcpps") and os.path.isfile(os.path.join(dirpath, f))]
2783+
opts = [f for f in os.listdir(dirpath) if (f.endswith(".kcpps") or f.endswith(".kcppt")) and os.path.isfile(os.path.join(dirpath, f))]
27842784
if targetfile in opts and os.path.exists(targetfilepath):
27852785
print(f"Admin: Received request to reload config to {targetfile}")
27862786
global_memory["restart_target"] = targetfile

0 commit comments

Comments
 (0)