Remove duplicate code

This commit is contained in:
oobabooga 2023-05-10 01:34:04 -03:00
parent ba445cf59f
commit bdf1274b5d
34 changed files with 32 additions and 180 deletions

View file

@ -16,14 +16,7 @@ from modules.extensions import apply_extensions
from modules.html_generator import chat_html_wrapper, make_thumbnail
from modules.text_generation import (generate_reply, get_encoded_length,
get_max_prompt_length)
# Replace multiple string pairs in a string
def replace_all(text, dic):
for i, j in dic.items():
text = text.replace(i, j)
return text
from modules.utils import replace_all
def generate_chat_prompt(user_input, state, **kwargs):