From 0cc740115d66506bc95dc53f4acba57780821921 Mon Sep 17 00:00:00 2001
From: Concedo <39025047+LostRuins@users.noreply.github.com>
Date: Tue, 3 Oct 2023 23:43:13 +0800
Subject: [PATCH] updated lite, improve horde worker (+1 squashed commits)
Squashed commits:
[a7c25999] improve horde worker
---
gpttype_adapter.cpp | 5 +++-
klite.embd | 71 ++++++++++++++++++++++++++++++++++++++-------
koboldcpp.py | 62 +++++++++++++++++++++------------------
3 files changed, 98 insertions(+), 40 deletions(-)
diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp
index 260f11021..366a64df8 100644
--- a/gpttype_adapter.cpp
+++ b/gpttype_adapter.cpp
@@ -1722,7 +1722,10 @@ generation_outputs gpttype_generate(const generation_inputs inputs, generation_o
if(inputs.unban_tokens_rt && id==eosID)
{
stopper_unused_tokens = remaining_tokens;
- printf("\n(EOS token triggered!)");
+ if(debugmode!=-1)
+ {
+ printf("\n(EOS token triggered!)");
+ }
remaining_tokens = 0;
last_stop_reason = stop_reason::EOS_TOKEN;
}
diff --git a/klite.embd b/klite.embd
index ccfedd89a..ec4ed5960 100644
--- a/klite.embd
+++ b/klite.embd
@@ -6,7 +6,7 @@ It requires no dependencies, installation or setup.
Just copy this single static HTML file anywhere and open it in a browser, or from a webserver.
Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite.
Kobold Lite is under the AGPL v3.0 License for the purposes of koboldcpp. Please do not remove this line.
-Current version: 74
+Current version: 75
-Concedo
-->
@@ -1754,13 +1754,13 @@ Current version: 74
const favivon_normal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAEtQTFRFAAAA+XJ0l09PsVdXcTw842hqw2hmTi4vMCQlb2eUgWtl+tGpBAMDEw4NPCkoFw8PJBgXt5WBVkxW4Nvf7Lia3Z+MpJnAZ05HnJOTYIS/NAAAABl0Uk5TAv////v//vT9//3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sqIiLpOWZi8BlvP0YcOVeTyo2mJbq3EXfjXyDvPuZuZ9SAjqwCdLr902yzLm4DdzYRyfPbpt8rGUu-Uw27Ix2oZRe_zj0G_3FdCw0"];
- const storymodels1 = ["erebus","nerys","nerybus","janeway","hermes","airoboros","chrono","llama","wizard","mantis","myth"];
+ const storymodels1 = ["erebus","nerys","nerybus","janeway","hermes","airoboros","chrono","llama","wizard","mantis","myth","xwin","spicyboros","mlewd"];
const storymodels2 = ["opt","vicuna","manticore","alpaca"];
- const adventuremodels1 = ["nerys","nerybus","skein","adventure","hermes","airoboros","chrono","llama","wizard","mantis","myth"];
+ const adventuremodels1 = ["nerys","nerybus","skein","adventure","hermes","airoboros","chrono","llama","wizard","mantis","myth","xwin","spicyboros","mlewd"];
const adventuremodels2 = ["erebus","janeway","opt","vicuna","manticore","alpaca"];
- const chatmodels1 = ["pygmalion-6","pygmalion-v8","hermes","airoboros","chrono","llama","wizard","mantis","myth"];
+ const chatmodels1 = ["pygmalion-6","pygmalion-v8","hermes","airoboros","chrono","llama","wizard","mantis","myth","xwin","pygmalion-2","spicyboros","mlewd"];
const chatmodels2 = ["pygmalion","janeway","nerys","erebus","nerybus","opt","vicuna","manticore","alpaca"];
- const instructmodels1 = ["gpt4all","supercot","hermes","airoboros","chrono","wizard","mantis","vicuna","manticore","alpaca","myth"];
+ const instructmodels1 = ["gpt4all","supercot","hermes","airoboros","chrono","wizard","mantis","vicuna","manticore","alpaca","myth","xwin","spicyboros","mlewd"];
const instructmodels2 = ["erebus","nerys","nerybus","janeway","opt","llama"];
const instructstartplaceholder = "\n{{[INPUT]}}\n";
@@ -2188,8 +2188,47 @@ Current version: 74
"memory":`[Character: Nail; species: Redscale Kobold; age: 20; gender: female; class: Hexblade Warlock with powers derived from draconic patron; physical appearance: 3' in height, 35 lbs, purple eyes, pink scales and peachy chest; equipment: Dragon's talon affixed to a handle as a blade; personality: lawful neutral; description: Nail (called Nannan in her native tongue) is a refugee of the once-proud Xabrakkar kobolds on the continent of Halkar. Founded above a series of geothermal caves, her tribe prospered as they dug into long-buried ruins for priceless treasures, which they brought to the surface. Amongst the ruins, Nail discovered the slumbering red dragon Rhindicar - once the familiar to one of the most powerful sorcerers to ever live. The sleeping dragon quickly became an object of worship for the Xabrakkar kobolds. However, the Trobian relics they unearthed attracted the attention of another - Hilezmaras, the mad tyrant, a covetous dragon who laid claim to the kobolds treasures, sending his fanatical dragonborn cult to purge their warren. While most of the kobolds were slain, a select few were dragon-marked, forcibly given a magic brand linking them to the mad dragon in order to turn them into powerful and obedient soldiers. Nail broke free of her captors after being given such a mark, fleeing into the tunnels leading to the Tinder Depths, eventually collapsing before Rhindicar and waking him from his slumber. Being raised from a hatchling by a kind and just master, Rhindicar was uncharacteristically compassionate for a dragon, and took pity on the young kobold. Though he was not powerful enough to remove Hilezmaras' brand, he was able to suppress its magical compulsion, allowing her to retain her free-will. He warned, though, that as the dragon-mark grew in power and became more strongly linked to the mad tyrant, he would no longer be able to keep it suppressed, and urged Nannan to seek out his former master, Rath Cinderstorm. Biting off a fragment of one of his talons, he gifted it to the kobold, both as a weapon, and as a conduit to help him suppress the effects of the brand. With no other options, Nannan returned to the warren and fought her way to the surface, eventually escaping Halkar and crossing the ocean to Fanne'Tar, where she assumed the alias 'Nail' in Common tongue and began her search for a long-missing sorcerer.]\n[The following is a chat message log between Nail and you.]\n`,
"authorsnote": "",
"worldinfo": []
+ },
+ {
+ "title":"Haunted Mansion",
+ "author":"Concedo",
+ "desc":"It was a dark and stormy night.",
+ "opmode":1,
+ "prefmodel1":storymodels1,
+ "prefmodel2":storymodels2,
+ "prompt": `It was a dark and stormy night when I arrived at the old Wellington Manor on the edge of town. Lightning flashed across the sky, briefly illuminating the imposing three-story mansion, the wind whipping dead leaves across the massive front porch. I had always thought the house looked creepy and foreboding, even in broad daylight, but it looked downright sinister now.\n\nAs I slowly approached the front door, I felt a nervous pit in my stomach. Maybe coming here alone at night during a storm wasn't the best idea. But my curiosity got the better of me. I had to see inside.\n\nThe front door creaked as I carefully pushed it open. I stepped cautiously over the threshold,`,
+ "memory": ``,
+ "authorsnote": "",
+ "worldinfo": []
+ },
+ {
+ "title":"Final Frontier",
+ "author":"Concedo",
+ "desc":"The spacebound adventures of the U.S.S Fairlight and her crew.",
+ "opmode":1,
+ "prefmodel1":storymodels1,
+ "prefmodel2":storymodels2,
+ "prompt": `The sleek silver hull of the U.S.S. Fairlight glinted in the light of the distant orange sun as the spacecraft approached the uncharted planetary system. Captain Adair sat in his command chair on the bridge, idly tapping his fingers on the armrest, gazing out the wide viewport at the alien world ahead.\n\n"Helmsman, take us into a standard orbit around the fourth planet," he ordered. The helmsman responded with a quick "Aye Captain" as he adjusted the Fairlight's course, the ship's engines humming as they responded.\n\nThe fourth planet loomed large now, a rusty ominous red orb banded with streaks of brown and gray. The crew on the bridge watched intently as`,
+ "memory": `Task: Write a lengthy science fiction prose about the adventures of the U.S.S Fairlight, an interstellar spacecraft exploring a distant star system.\n\nStory: `,
+ "authorsnote": "",
+ "worldinfo": []
+ },
+ {
+ "title":"Shipwrecked",
+ "author":"Concedo",
+ "desc":"Shipwrecked on a deserted island with your sister.",
+ "opmode":2,
+ "prefmodel1":adventuremodels1,
+ "prefmodel2":adventuremodels2,
+ "prompt":`You and your sister Megan were enjoying a sailing vacation in the tropics, when your yacht got caught in the worst thunderstorm of your life. After a harrowing escape as your boat capsized and sank, you now find yourself shipwrecked on a deserted island.\n\nAs you struggle to get up, tasting the salty sea breeze and brushing the coarse sand off your body, you see your sister laying on the beach a short distance away, unconscious but alive.`,
+ "adventure_context_mod":false,
+ "adventure_is_action":true,
+ "memory": `[Interactive Fiction: Game Mode Enabled]\n[You are playing a choose-your-own-adventure game. Please input action.]\n`,
+ "authorsnote": "",
+ "worldinfo": []
}
+
];
@@ -4518,7 +4557,7 @@ Current version: 74
{
scenarioautopickai = true; //no selected model, pick a good one
}
- if (scenarioautopickai && !localflag)
+ if (scenarioautopickai && !localflag && !is_using_custom_ep())
{
fetch_models((mdls) =>
{
@@ -4528,7 +4567,7 @@ Current version: 74
}
else
{
- let nsfwmodels = ["erebus","shinen","horni","litv2","lit-6b"];
+ let nsfwmodels = ["erebus","shinen","horni","litv2","lit-6b","spicyboros","mlewd"];
selected_models = [];
for (var i = 0; i < mdls.length; ++i) {
for (var j = 0; j < temp_scenario.prefmodel1.length; ++j) {
@@ -5194,6 +5233,10 @@ Current version: 74
selected_models = [];
selected_workers = [];
custom_kobold_endpoint = "";
+ if(localflag)
+ {
+ document.getElementById("connectstatus").innerHTML = "Offline Mode";
+ }
render_gametext();
} else {
uses_cors_proxy = true; //fallback to cors proxy, this will remain for rest of session
@@ -7306,7 +7349,7 @@ Current version: 74
"prompt": submit_payload.prompt,
"max_tokens_to_sample": submit_payload.params.max_length,
"model": custom_claude_model,
- "top_k": (submit_payload.params.top_k<=0?-1:submit_payload.params.top_k),
+ "top_k": (submit_payload.params.top_k<1?300:submit_payload.params.top_k),
"temperature": submit_payload.params.temperature,
"top_p": submit_payload.params.top_p,
}
@@ -7370,7 +7413,7 @@ Current version: 74
"temperature":submit_payload.params.temperature,
"maxOutputTokens": submit_payload.params.max_length,
"topP": submit_payload.params.top_p,
- "topK": (submit_payload.params.top_k<1?9999:submit_payload.params.top_k),
+ "topK": (submit_payload.params.top_k<1?300:submit_payload.params.top_k),
"candidateCount":1};
fetch(targetep, {
@@ -8378,7 +8421,12 @@ Current version: 74
if (gametext_arr.length == 0 && synchro_pending_stream=="" && pending_response_id=="") {
if (perfdata == null) {
- document.getElementById("gametext").innerHTML = "Welcome to KoboldAI Lite! You are in Offline Mode. You will still be able to load and edit stories, but not generate new text."
+ if(document.getElementById("connectstatus").innerHTML == "Offline Mode")
+ {
+ document.getElementById("gametext").innerHTML = "Welcome to KoboldAI Lite! You are in Offline Mode. You will still be able to load and edit stories, but not generate new text."
+ }else{
+ document.getElementById("gametext").innerHTML = "Welcome to KoboldAI Lite! Attempting to Connect..."
+ }
} else {
let whorun = "";
@@ -9667,7 +9715,8 @@ Current version: 74
-
Connecting...
+
Loading...
+
diff --git a/koboldcpp.py b/koboldcpp.py
index a498129d0..d1a47bc71 100755
--- a/koboldcpp.py
+++ b/koboldcpp.py
@@ -365,6 +365,8 @@ KcppVersion = "1.46"
showdebug = True
showsamplerwarning = True
showmaxctxwarning = True
+session_kudos_earned = 0
+session_starttime = None
exitcounter = 0
totalgens = 0
currentusergenkey = "" #store a special key so polled streaming works even in multiuser
@@ -1370,7 +1372,7 @@ def show_gui_msgbox(title,message):
def run_horde_worker(args, api_key, worker_name):
import urllib.request
from datetime import datetime
- global friendlymodelname, maxhordectx, maxhordelen, exitcounter, modelbusy
+ global friendlymodelname, maxhordectx, maxhordelen, exitcounter, modelbusy, session_starttime
epurl = f"http://localhost:{args.port}"
if args.host!="":
epurl = f"http://{args.host}:{args.port}"
@@ -1378,11 +1380,30 @@ def run_horde_worker(args, api_key, worker_name):
def print_with_time(txt):
print(f"{datetime.now().strftime('[%H:%M:%S]')} " + txt)
+ def submit_completed_generation(jobid, submit_dict):
+ global exitcounter, session_kudos_earned, session_starttime
+ reply = make_url_request(cluster + '/api/v2/generate/text/submit', submit_dict)
+ if not reply:
+ exitcounter += 1
+ print_with_time(f"Error, Job submit failed.")
+ time.sleep(0.1)
+ else:
+ reward = reply["reward"]
+ session_kudos_earned += reward
+ curtime = datetime.now()
+ elapsedtime=curtime-session_starttime
+ hrs = elapsedtime.seconds // 3600
+ mins = elapsedtime.seconds // 60 % 60
+ secs = elapsedtime.seconds % 60
+ elapsedtimestr = f"{hrs:03d}h:{mins:02d}m:{secs:02d}s"
+ earnrate = session_kudos_earned/(elapsedtime.seconds/3600)
+ print_with_time(f'Submitted {jobid} and earned {reward:.0f} kudos\n[Total:{session_kudos_earned:.0f} kudos, Time:{elapsedtimestr}, EarnRate:{earnrate:.0f} kudos/hr]')
+ time.sleep(0.1)
def make_url_request(url, data, method='POST'):
try:
request = None
- headers = {"apikey": api_key,'User-Agent':'KoboldCpp Embedded Worker v1','Client-Agent':'KoboldCppEmbedWorker:1'}
+ headers = {"apikey": api_key,'User-Agent':'KoboldCppEmbeddedWorkerV2','Client-Agent':'KoboldCppEmbedWorker:2'}
if method=='POST':
json_payload = json.dumps(data).encode('utf-8')
request = urllib.request.Request(url, data=json_payload, headers=headers, method=method)
@@ -1408,17 +1429,16 @@ def run_horde_worker(args, api_key, worker_name):
current_id = None
current_payload = None
current_generation = None
- session_kudos_earned = 0
session_starttime = datetime.now()
sleepy_counter = 0 #if this exceeds a value, worker becomes sleepy (slower)
- print("===\nEmbedded Horde Worker '"+worker_name+"' Starting...\n(To use your own KAI Bridge/Scribe worker instead, don't set your API key)")
- BRIDGE_AGENT = f"KoboldCppEmbedWorker:1:https://github.com/LostRuins/koboldcpp"
+ print(f"===\nEmbedded Horde Worker '{worker_name}' Starting...\n(To use your own KAI Bridge/Scribe worker instead, don't set your API key)")
+ BRIDGE_AGENT = f"KoboldCppEmbedWorker:2:https://github.com/LostRuins/koboldcpp"
cluster = "https://horde.koboldai.net"
while exitcounter < 10:
time.sleep(3)
readygo = make_url_request(f'{epurl}/api/v1/info/version', None,'GET')
if readygo:
- print_with_time(f"Embedded Horde Worker is started.")
+ print_with_time(f"Embedded Horde Worker '{worker_name}' is started.")
break
while exitcounter < 10:
@@ -1427,7 +1447,7 @@ def run_horde_worker(args, api_key, worker_name):
#first, make sure we are not generating
if modelbusy.locked():
- time.sleep(0.3)
+ time.sleep(0.2)
continue
#pop new request
@@ -1448,7 +1468,6 @@ def run_horde_worker(args, api_key, worker_name):
continue
if not pop["id"]:
slp = (1 if sleepy_counter<10 else (2 if sleepy_counter<25 else 3))
- #print(f"Server {cluster} has no valid generations for us. Sleep for {slp}s")
time.sleep(slp)
sleepy_counter += 1
if sleepy_counter==20:
@@ -1471,7 +1490,7 @@ def run_horde_worker(args, api_key, worker_name):
currentjob_attempts += 1
if currentjob_attempts>5:
break
- print_with_time("Server Busy - Not ready to generate...")
+ print_with_time(f"Server Busy - Not ready to generate...")
time.sleep(5)
#submit reply
@@ -1482,32 +1501,19 @@ def run_horde_worker(args, api_key, worker_name):
"generation": current_generation["results"][0]["text"],
"state": "ok"
}
- reply = make_url_request(cluster + '/api/v2/generate/text/submit', submit_dict)
- if not reply:
- exitcounter += 1
- print_with_time("Error: Job submit failed.")
- else:
- reward = reply["reward"]
- session_kudos_earned += reward
- curtime = datetime.now()
- elapsedtime=curtime-session_starttime
- hrs = elapsedtime.seconds // 3600
- mins = elapsedtime.seconds // 60 % 60
- secs = elapsedtime.seconds % 60
- elapsedtimestr = f"{hrs:03d}h:{mins:02d}m:{secs:02d}s"
- earnrate = session_kudos_earned/(elapsedtime.seconds/3600)
- print_with_time(f'Submitted {current_id} and earned {reward:.0f} kudos\n[Total:{session_kudos_earned:.0f} kudos, Time:{elapsedtimestr}, EarnRate:{earnrate:.0f} kudos/hr]')
+ submit_thread = threading.Thread(target=submit_completed_generation, args=(current_id, submit_dict))
+ submit_thread.start() #submit job in new thread so nothing is waiting
else:
- print_with_time("Error: Abandoned current job due to errors. Getting new job.")
+ print_with_time(f"Error, Abandoned current job due to errors. Getting new job.")
current_id = None
current_payload = None
- time.sleep(0.2)
+ time.sleep(0.1)
if exitcounter<100:
- print_with_time("Horde Worker Shutdown - Too many errors.")
+ print_with_time(f"Horde Worker Shutdown - Too many errors.")
time.sleep(3)
else:
- print_with_time("Horde Worker Shutdown - Server Closing.")
+ print_with_time(f"Horde Worker Shutdown - Server Closing.")
time.sleep(3)
sys.exit(2)