Clean up server code. Fix oobabooga multigen with streaming. Pass Gradio fn_index as a request header

This commit is contained in:
SillyLossy
2023-04-13 21:50:20 +03:00
parent 58ed03dfe0
commit f7e89b345d
5 changed files with 52 additions and 103 deletions

View File

@ -1244,8 +1244,8 @@ class StreamingProcessor {
}
try {
this.result = this.prefix + text;
this.onProgressStreaming(this.messageId, this.result);
this.result = text;
this.onProgressStreaming(this.messageId, message_already_generated + text);
}
catch (err) {
console.error(err);
@ -1887,7 +1887,7 @@ async function Generate(type, automatic_trigger, force_name2) {
}
}
else if (main_api == 'textgenerationwebui' && textgenerationwebui_settings.streaming) {
streamingProcessor.generator = await generateTextGenWithStreaming(generate_data, finalPromt);
streamingProcessor.generator = await generateTextGenWithStreaming(generate_data);
}
else {
jQuery.ajax({
@ -1919,6 +1919,8 @@ async function Generate(type, automatic_trigger, force_name2) {
console.log('returning to make generate again');
return;
}
getMessage = message_already_generated;
}
if (streamingProcessor.isFinished) {