mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
updated lite, added patch that links to noscript mode
This commit is contained in:
parent
c7511526a2
commit
930cdfb1ce
2 changed files with 115 additions and 43 deletions
10
koboldcpp.py
10
koboldcpp.py
|
@ -2274,15 +2274,21 @@ def main(launch_args,start_server=True):
|
|||
basepath = os.path.abspath(os.path.dirname(__file__))
|
||||
with open(os.path.join(basepath, "klite.embd"), mode='rb') as f:
|
||||
embedded_kailite = f.read()
|
||||
# patch it with extra stuff
|
||||
origStr = "Sorry, Kobold Lite requires Javascript to function."
|
||||
patchedStr = "Sorry, Kobold Lite requires Javascript to function.<br>You can use <a class=\"color_blueurl\" href=\"/noscript\">KoboldCpp NoScript mode</a> instead."
|
||||
embedded_kailite = embedded_kailite.decode("UTF-8","ignore")
|
||||
embedded_kailite = embedded_kailite.replace(origStr, patchedStr)
|
||||
embedded_kailite = embedded_kailite.encode()
|
||||
print("Embedded Kobold Lite loaded.")
|
||||
except:
|
||||
except Exception as e:
|
||||
print("Could not find Kobold Lite. Embedded Kobold Lite will not be available.")
|
||||
|
||||
try:
|
||||
basepath = os.path.abspath(os.path.dirname(__file__))
|
||||
with open(os.path.join(basepath, "kcpp_docs.embd"), mode='rb') as f:
|
||||
embedded_kcpp_docs = f.read()
|
||||
except:
|
||||
except Exception as e:
|
||||
print("Could not find Embedded KoboldCpp API docs.")
|
||||
|
||||
if args.port_param!=defaultport:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue