mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Clean up server code. Fix oobabooga multigen with streaming. Pass Gradio fn_index as a request header
This commit is contained in:
@ -30,6 +30,7 @@ let textgenerationwebui_settings = {
|
||||
truncation_length: 2048,
|
||||
ban_eos_token: false,
|
||||
streaming: false,
|
||||
fn_index: 29,
|
||||
};
|
||||
|
||||
let textgenerationwebui_presets = [];
|
||||
@ -52,6 +53,7 @@ const setting_names = [
|
||||
"seed",
|
||||
"add_bos_token",
|
||||
"ban_eos_token",
|
||||
"fn_index",
|
||||
];
|
||||
|
||||
function selectPreset(name) {
|
||||
@ -143,12 +145,13 @@ function setSettingByName(i, value, trigger) {
|
||||
}
|
||||
}
|
||||
|
||||
async function generateTextGenWithStreaming(generate_data, finalPromt) {
|
||||
async function generateTextGenWithStreaming(generate_data) {
|
||||
const response = await fetch('/generate_textgenerationwebui', {
|
||||
headers: {
|
||||
'X-CSRF-Token': token,
|
||||
'Content-Type': 'application/json',
|
||||
'X-Response-Streaming': true,
|
||||
'X-Gradio-Streaming-Function': textgenerationwebui_settings.fn_index,
|
||||
},
|
||||
body: JSON.stringify(generate_data),
|
||||
method: 'POST',
|
||||
|
Reference in New Issue
Block a user