diff --git a/modules/html_generator.py b/modules/html_generator.py index 86771dcf..902ffcc7 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -101,6 +101,17 @@ def convert_to_markdown(string): return html_output +def convert_to_markdown_wrapped(string, use_cache=True): + ''' + Used to avoid caching convert_to_markdown calls during streaming. + ''' + + if use_cache: + return convert_to_markdown(string) + + return convert_to_markdown.__wrapped__(string) + + def generate_basic_html(string): string = convert_to_markdown(string) string = f'