mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Streaming: Fix bad streamingwindow sync
sometimes the good solution is the best solution
This commit is contained in:
@@ -3279,6 +3279,9 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False,
|
||||
if(koboldai_vars.aibusy):
|
||||
return
|
||||
|
||||
# Open up token stream
|
||||
emit("stream_tokens", True, broadcast=True, room="UI_2")
|
||||
|
||||
while(True):
|
||||
set_aibusy(1)
|
||||
koboldai_vars.actions.clear_unused_options()
|
||||
|
@@ -529,8 +529,6 @@ function process_actions_data(data) {
|
||||
game_text_scroll_timeout = setTimeout(run_infinite_scroll_update.bind(null, action_type, actions, first_action), 200);
|
||||
clearTimeout(auto_loader_timeout);
|
||||
|
||||
streaming.windowOpen = true;
|
||||
|
||||
hide_show_prompt();
|
||||
//console.log("Took "+((Date.now()-start_time)/1000)+"s to process");
|
||||
|
||||
@@ -3357,7 +3355,6 @@ function update_game_text(id, new_text) {
|
||||
socket.emit("Set Selected Text", {"id": id, "text": ""});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function stream_tokens(tokens) {
|
||||
@@ -3366,6 +3363,11 @@ function stream_tokens(tokens) {
|
||||
|
||||
let streamBuffer = $el("#token-stream-buffer");
|
||||
|
||||
if (tokens === true) {
|
||||
streaming.windowOpen = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!streaming.windowOpen) {
|
||||
// Reject tokens sent after the streaming window is closed
|
||||
return;
|
||||
@@ -3402,6 +3404,7 @@ function stream_tokens(tokens) {
|
||||
// Get the average time (ms) it took the last 5 tokens to generate
|
||||
|
||||
if (!streaming.typeyTimeout) return;
|
||||
if (!streaming.windowOpen) return;
|
||||
if (!smoothStreamingEnabled) return;
|
||||
streaming.typeyTimeout = setTimeout(_char, avg);
|
||||
|
||||
|
Reference in New Issue
Block a user