UI: Only add a blank space to streaming messages in instruct mode

This commit is contained in:
oobabooga 2025-05-16 17:48:54 -07:00
parent 71fa046c17
commit e3bba510d4
3 changed files with 3 additions and 3 deletions

View file

@ -390,7 +390,7 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
margin-left: auto;
margin-right: auto;
flex: 1;
overflow-y: auto;
overflow-y: hidden;
display: flex;
flex-direction: column;
word-break: break-word;

View file

@ -152,7 +152,7 @@ const observer = new MutationObserver(function(mutations) {
}
const chatElement = document.getElementById("chat");
if (chatElement) {
if (chatElement && chatElement.getAttribute("data-mode") === "instruct") {
const messagesContainer = chatElement.querySelector(".messages");
const lastChild = messagesContainer?.lastElementChild;
const prevSibling = lastChild?.previousElementSibling;

View file

@ -347,7 +347,7 @@ remove_button = f'<button class="footer-button footer-remove-button" title="Remo
def generate_instruct_html(history):
output = f'<style>{instruct_css}</style><div class="chat" id="chat"><div class="messages">'
output = f'<style>{instruct_css}</style><div class="chat" id="chat" data-mode="instruct"><div class="messages">'
for i in range(len(history['visible'])):
row_visible = history['visible'][i]