move embeds into their own dir, detach sd vocab into separate files

This commit is contained in:
Concedo
2025-10-03 14:21:09 +08:00
parent c00ae93421
commit 4f8f0e5949
26 changed files with 178401 additions and 41 deletions
+5 -7
View File
@@ -6506,7 +6506,7 @@ def delete_old_pyinstaller():
if absdirpath!=selfdirpath and (time.time() - os.path.getctime(absdirpath)) > 14400: # remove if older than 4 hours
kobold_itemcheck1 = os.path.join(absdirpath, 'koboldcpp_default.dll')
kobold_itemcheck2 = os.path.join(absdirpath, 'koboldcpp_default.so')
kobold_itemcheck3 = os.path.join(absdirpath, 'klite.embd')
kobold_itemcheck3 = os.path.join(absdirpath, 'koboldcpp.py')
kobold_itemcheck4 = os.path.join(absdirpath, 'cublasLt64_11.dll')
kobold_itemcheck5 = os.path.join(absdirpath, 'cublas64_11.dll')
kobold_itemcheck6 = os.path.join(absdirpath, 'clblast.dll')
@@ -7412,9 +7412,9 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
#load embedded lite
embddir = os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))),"embd_res")
try:
basepath = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
with open(os.path.join(basepath, "klite.embd"), mode='rb') as f:
with open(os.path.join(embddir, "klite.embd"), mode='rb') as f:
embedded_kailite = f.read()
# patch it with extra stuff
patches = [{"find":"Sorry, KoboldAI Lite requires Javascript to function.","replace":"Sorry, KoboldAI Lite requires Javascript to function.<br>You can use <a class=\"color_blueurl\" href=\"/noscript\">KoboldCpp NoScript mode</a> instead."},
@@ -7429,16 +7429,14 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
print("Could not find KoboldAI Lite. Embedded KoboldAI Lite will not be available.")
try:
basepath = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
with open(os.path.join(basepath, "kcpp_docs.embd"), mode='rb') as f:
with open(os.path.join(embddir, "kcpp_docs.embd"), mode='rb') as f:
embedded_kcpp_docs = f.read()
print("Embedded API docs loaded.")
except Exception:
print("Could not find Embedded KoboldCpp API docs.")
try:
basepath = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
with open(os.path.join(basepath, "kcpp_sdui.embd"), mode='rb') as f:
with open(os.path.join(embddir, "kcpp_sdui.embd"), mode='rb') as f:
embedded_kcpp_sdui = f.read()
if args.sdmodel:
print("Embedded SDUI loaded.")