mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-29 15:44:12 +00:00
more bugfixes
This commit is contained in:
parent
5e6383fb81
commit
714b4d6bb3
2
app.py
2
app.py
@ -252,7 +252,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
|
||||
def run_to(self):
|
||||
data = request.get_json()
|
||||
message_id = data["id"]
|
||||
message_id = int(data["id"])
|
||||
self.stop = True
|
||||
# Segmented (the user receives the output as it comes)
|
||||
# We will first send a json entry that contains the message id and so on, then the text as it goes
|
||||
|
@ -146,19 +146,27 @@ function addMessage(sender, message, id, rank = 0, can_edit = false) {
|
||||
entry_counter++;
|
||||
}
|
||||
else {
|
||||
// For the other enrtries, these are just the text of the chatbot
|
||||
for (const char of text) {
|
||||
txt = hiddenElement_.innerHTML;
|
||||
if (char != '\f') {
|
||||
txt += char
|
||||
hiddenElement_.innerHTML = txt
|
||||
messageTextElement_.innerHTML = txt
|
||||
}
|
||||
|
||||
// scroll to bottom of chat window
|
||||
chatWindow.scrollTop = chatWindow.scrollHeight;
|
||||
}
|
||||
entry_counter++;
|
||||
prefix = "FINAL:";
|
||||
if(text.startsWith(prefix)){
|
||||
text = text.substring(prefix.length);
|
||||
hiddenElement.innerHTML = text
|
||||
messageTextElement.innerHTML = text
|
||||
}
|
||||
else{
|
||||
// For the other enrtries, these are just the text of the chatbot
|
||||
for (const char of text) {
|
||||
txt = hiddenElement_.innerHTML;
|
||||
if (char != '\f') {
|
||||
txt += char
|
||||
hiddenElement_.innerHTML = txt
|
||||
messageTextElement_.innerHTML = txt
|
||||
}
|
||||
|
||||
// scroll to bottom of chat window
|
||||
chatWindow.scrollTop = chatWindow.scrollHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readStream();
|
||||
|
Loading…
x
Reference in New Issue
Block a user