From 0e673a7a4278deaedb3513b4e406cdcc45b19b4e Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 4 Jan 2025 11:40:24 -0800 Subject: [PATCH] UI: reduce the size of HTML sent to the UI during streaming --- modules/html_generator.py | 130 +++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 72 deletions(-) diff --git a/modules/html_generator.py b/modules/html_generator.py index e61fc558..1f12d77a 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -268,29 +268,24 @@ def generate_instruct_html(history): for i, _row in enumerate(history): row = [convert_to_markdown_wrapped(entry, use_cache=i != len(history) - 1) for entry in _row] - if row[0]: # don't display empty user messages - output += f""" -
- """ + if row[0]: # Don't display empty user messages + output += ( + f' ' + ) - output += f""" - - """ + output += ( + f' ' + ) output += "" - return output @@ -298,44 +293,39 @@ def generate_cai_chat_html(history, name1, name2, style, character, reset_cache= output = f'