mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 17:44:38 +00:00
change singleinstance order
This commit is contained in:
parent
d18938fc70
commit
6effb65cfe
3 changed files with 19 additions and 14 deletions
|
@ -51,9 +51,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
./koboldcpp.sh dist
|
./koboldcpp.sh dist
|
||||||
|
|
||||||
- name: Rename file before upload
|
|
||||||
run: mv dist/koboldcpp-linux-x64-cuda1240 dist/koboldcpp-linux-x64-cuda12
|
|
||||||
|
|
||||||
- name: Save artifact
|
- name: Save artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -23964,8 +23964,11 @@ Current version indicated by LITEVER below.
|
||||||
<option value="2">2x</option>
|
<option value="2">2x</option>
|
||||||
<option value="3">3x</option>
|
<option value="3">3x</option>
|
||||||
<option value="5">5x</option>
|
<option value="5">5x</option>
|
||||||
<option value="8">8x</option>
|
|
||||||
<option value="10">10x</option>
|
<option value="10">10x</option>
|
||||||
|
<option value="15">15x</option>
|
||||||
|
<option value="20">20x</option>
|
||||||
|
<option value="30">30x</option>
|
||||||
|
<option value="50">50x</option>
|
||||||
</select>
|
</select>
|
||||||
<select title="Idle Responses Duration" style="padding:1px; height:auto; width: 27px; appearance: none; font-size: 7pt;" class="form-control" id="idle_duration">
|
<select title="Idle Responses Duration" style="padding:1px; height:auto; width: 27px; appearance: none; font-size: 7pt;" class="form-control" id="idle_duration">
|
||||||
<option value="5">5s</option>
|
<option value="5">5s</option>
|
||||||
|
|
25
koboldcpp.py
25
koboldcpp.py
|
@ -3812,13 +3812,6 @@ def RunServerMultiThreaded(addr, port, server_handler):
|
||||||
global embedded_kailite, embedded_kcpp_docs, embedded_kcpp_sdui, global_memory
|
global embedded_kailite, embedded_kcpp_docs, embedded_kcpp_sdui, global_memory
|
||||||
if is_port_in_use(port):
|
if is_port_in_use(port):
|
||||||
print(f"Warning: Port {port} already appears to be in use by another program.")
|
print(f"Warning: Port {port} already appears to be in use by another program.")
|
||||||
if args.singleinstance:
|
|
||||||
print(f"Attempting to request shutdown of previous instance on port {port}...")
|
|
||||||
shutdownreq = make_url_request(f'http://localhost:{port}/api/extra/shutdown',{})
|
|
||||||
shutdownok = (shutdownreq and "success" in shutdownreq and shutdownreq["success"] is True)
|
|
||||||
time.sleep(2)
|
|
||||||
print("Shutdown existing successful!" if shutdownok else "Shutdown existing failed!")
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
ipv4_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
ipv4_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
ipv4_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
ipv4_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
|
@ -6536,6 +6529,21 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
||||||
args.defaultgenamt = max(128, min(args.defaultgenamt, 4096))
|
args.defaultgenamt = max(128, min(args.defaultgenamt, 4096))
|
||||||
args.defaultgenamt = min(args.defaultgenamt, maxctx / 2)
|
args.defaultgenamt = min(args.defaultgenamt, maxctx / 2)
|
||||||
|
|
||||||
|
if args.port_param!=defaultport:
|
||||||
|
args.port = args.port_param
|
||||||
|
|
||||||
|
if start_server and args.singleinstance and is_port_in_use(args.port):
|
||||||
|
try:
|
||||||
|
print(f"Warning: Port {args.port} already appears to be in use by another program.")
|
||||||
|
print(f"Attempting to request shutdown of previous instance on port {args.port}...")
|
||||||
|
shutdownreq = make_url_request(f'http://localhost:{args.port}/api/extra/shutdown',{},timeout=5)
|
||||||
|
shutdownok = (shutdownreq and "success" in shutdownreq and shutdownreq["success"] is True)
|
||||||
|
time.sleep(2)
|
||||||
|
print("Shutdown existing successful!" if shutdownok else "Shutdown existing failed!")
|
||||||
|
time.sleep(1)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
if args.nocertify:
|
if args.nocertify:
|
||||||
import ssl
|
import ssl
|
||||||
global nocertify
|
global nocertify
|
||||||
|
@ -6839,9 +6847,6 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
||||||
print(f"Inactive Modules: {' '.join(disabledmlist)}")
|
print(f"Inactive Modules: {' '.join(disabledmlist)}")
|
||||||
print(f"Enabled APIs: {' '.join(apimlist)}")
|
print(f"Enabled APIs: {' '.join(apimlist)}")
|
||||||
|
|
||||||
if args.port_param!=defaultport:
|
|
||||||
args.port = args.port_param
|
|
||||||
|
|
||||||
global sslvalid
|
global sslvalid
|
||||||
if args.ssl:
|
if args.ssl:
|
||||||
if len(args.ssl)==2 and isinstance(args.ssl[0], str) and os.path.exists(args.ssl[0]) and isinstance(args.ssl[1], str) and os.path.exists(args.ssl[1]):
|
if len(args.ssl)==2 and isinstance(args.ssl[0], str) and os.path.exists(args.ssl[0]) and isinstance(args.ssl[1], str) and os.path.exists(args.ssl[1]):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue