mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Optimize the UI by caching convert_to_markdown calls
This commit is contained in:
parent
056717923f
commit
afadc787d7
@ -2,6 +2,7 @@ import html
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
import functools
|
||||
from pathlib import Path
|
||||
|
||||
import markdown
|
||||
@ -47,6 +48,7 @@ def replace_blockquote(m):
|
||||
return m.group().replace('\n', '\n> ').replace('\\begin{blockquote}', '').replace('\\end{blockquote}', '')
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=512)
|
||||
def convert_to_markdown(string):
|
||||
|
||||
# Blockquote
|
||||
|
Loading…
Reference in New Issue
Block a user