mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-04-28 03:30:20 +00:00
fix: Autoswap with override configs (#2091)
* fix: Autoswap with overrides * fix: Autoswap with overrides
This commit is contained in:
parent
376aaf258c
commit
11bc83229a
2 changed files with 9 additions and 5 deletions
|
|
@ -31295,11 +31295,11 @@ Current version indicated by LITEVER below.
|
|||
<b class="color_white" style="padding: 5px;">Change Loaded Model / Config:</b><br>
|
||||
<div class="color_white" style="padding: 5px;">
|
||||
<div style="padding-top:3px">
|
||||
Select New Target: <select title="Select New Config" style="padding:4px; width:100%" class="form-control" id="adminconfigdropdown">
|
||||
Select Primary Target: <select title="Select New Config" style="padding:4px; width:100%" class="form-control" id="adminconfigdropdown">
|
||||
</select>
|
||||
</div>
|
||||
<div style="padding-top:3px">
|
||||
Select Base Config: <select title="Override Config" style="padding:4px; width:100%" class="form-control" id="adminconfigoverridedropdown">
|
||||
Select Secondary Target (optional): <select title="Override Config" style="padding:4px; width:100%" class="form-control" id="adminconfigoverridedropdown">
|
||||
</select>
|
||||
</div>
|
||||
<div style="display:flex; padding: 5px; justify-content: center;">
|
||||
|
|
|
|||
10
koboldcpp.py
10
koboldcpp.py
|
|
@ -74,7 +74,7 @@ extra_images_max = 4 # for kontext/qwen img
|
|||
KcppVersion = "1.111.1"
|
||||
showdebug = True
|
||||
kcpp_instance = None #global running instance
|
||||
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":"", "last_active_timestamp":datetime.now(), "triggered_sleeping":False, "current_model":"initial_model", "swapReqType": None, "autoswapmode": False}
|
||||
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":"", "last_active_timestamp":datetime.now(), "triggered_sleeping":False, "current_model":"initial_model", "current_override":"", "swapReqType": None, "autoswapmode": False}
|
||||
using_gui_launcher = False
|
||||
|
||||
handle = None
|
||||
|
|
@ -4075,7 +4075,7 @@ class KcppProxyHandler(http.server.BaseHTTPRequestHandler):
|
|||
|
||||
if (global_memory["swapReqType"] is not None and swapModeChanged):
|
||||
with proxy_reload_lock:
|
||||
reqbody = json.dumps({"filename":global_memory["current_model"]})
|
||||
reqbody = json.dumps({"filename":global_memory["current_model"], "overrideconfig": global_memory["current_override"]})
|
||||
reqheaders = {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': str(len(reqbody)),
|
||||
|
|
@ -9454,7 +9454,7 @@ def main(launch_args, default_args):
|
|||
input()
|
||||
else: # manager command queue for admin mode
|
||||
with multiprocessing.Manager() as mp_manager:
|
||||
global_memory = mp_manager.dict({"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":"", "last_active_timestamp":datetime.now(), "triggered_sleeping":False, "current_model":"initial_model", "swapReqType": None, "autoswapmode": False})
|
||||
global_memory = mp_manager.dict({"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":"", "last_active_timestamp":datetime.now(), "triggered_sleeping":False, "current_model":"initial_model", "current_override":"", "swapReqType": None, "autoswapmode": False})
|
||||
|
||||
if args.remotetunnel and not args.prompt and not args.benchmark and not args.cli:
|
||||
setuptunnel(global_memory, True if args.sdmodel else False)
|
||||
|
|
@ -9558,6 +9558,10 @@ def main(launch_args, default_args):
|
|||
kcpp_instance.daemon = True
|
||||
kcpp_instance.start()
|
||||
global_memory["restart_target"] = ""
|
||||
if (restart_override_config_target and restart_override_config_target!=""):
|
||||
global_memory["current_override"] = restart_override_config_target
|
||||
else:
|
||||
global_memory["current_override"] = ""
|
||||
global_memory["restart_override_config_target"] = ""
|
||||
global_memory["current_model"] = restart_target
|
||||
time.sleep(3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue