mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 09:19:23 +01: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 os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
import functools
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import markdown
|
import markdown
|
||||||
@ -47,6 +48,7 @@ def replace_blockquote(m):
|
|||||||
return m.group().replace('\n', '\n> ').replace('\\begin{blockquote}', '').replace('\\end{blockquote}', '')
|
return m.group().replace('\n', '\n> ').replace('\\begin{blockquote}', '').replace('\\end{blockquote}', '')
|
||||||
|
|
||||||
|
|
||||||
|
@functools.lru_cache(maxsize=512)
|
||||||
def convert_to_markdown(string):
|
def convert_to_markdown(string):
|
||||||
|
|
||||||
# Blockquote
|
# Blockquote
|
||||||
|
Loading…
Reference in New Issue
Block a user