mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-04 14:17:28 +00:00
Optimize the UI by caching convert_to_markdown calls
This commit is contained in:
parent
056717923f
commit
afadc787d7
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue