mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
Update webapp.py
This commit is contained in:
parent
75139c2e10
commit
5059a1ae1e
1 changed files with 141 additions and 124 deletions
|
@ -1041,23 +1041,10 @@ let prompt = JSON.parse(document.querySelector("#prompt").textContent);
|
|||
if(v.length>6) result = v.slice(6);
|
||||
if(result == "[DONE]")
|
||||
{
|
||||
return;
|
||||
}
|
||||
const { choices } = JSON.parse(result);
|
||||
if(choices[0].logprobs.text_offset[0] > text_offset)
|
||||
{
|
||||
chatTextRawIntro+=choices[0].text
|
||||
text_offset = choices[0].logprobs.text_offset[choices[0].logprobs.text_offset.length - 1]
|
||||
}
|
||||
markdownToHtml(beautify(chatTextRawIntro+'\n'), document.getElementById('chat_intro'));
|
||||
|
||||
})
|
||||
return readerIntro.read().then(processText);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
text_offset = -1;
|
||||
const options = {
|
||||
|
@ -1076,7 +1063,7 @@ let prompt = JSON.parse(document.querySelector("#prompt").textContent);
|
|||
if(v.length>6) result = v.slice(6);
|
||||
if(result == "[DONE]")
|
||||
{
|
||||
chatTextRawPlusComment = chatTextRaw+"\n";
|
||||
chatTextRawPlusComment = chatTextRaw+"\n\n";
|
||||
text_offset = -1;
|
||||
const optionsPlus = {
|
||||
method: "POST",
|
||||
|
@ -1142,6 +1129,36 @@ let prompt = JSON.parse(document.querySelector("#prompt").textContent);
|
|||
console.error('Error:', error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
const { choices } = JSON.parse(result);
|
||||
if(choices[0].logprobs.text_offset[0] > text_offset)
|
||||
{
|
||||
chatTextRawIntro+=choices[0].text
|
||||
text_offset = choices[0].logprobs.text_offset[choices[0].logprobs.text_offset.length - 1]
|
||||
}
|
||||
markdownToHtml(beautify(chatTextRawIntro+'\n'), document.getElementById('chat_intro'));
|
||||
|
||||
})
|
||||
return readerIntro.read().then(processText);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
'''
|
||||
# for i in range(1,16):
|
||||
|
|
Loading…
Add table
Reference in a new issue