Spaces:
Runtime error
Runtime error
fix: use one star
Browse files
app.py
CHANGED
@@ -567,7 +567,7 @@ def format_prompt(message, history, system_prompt):
|
|
567 |
prompt += f"{user_prompt}"
|
568 |
prompt += f"{bot_response}"
|
569 |
prompt += f"""{message}"""
|
570 |
-
return prompt.replace('\n','؛').replace('\t','/').replace('
|
571 |
|
572 |
def generate(
|
573 |
prompt, history, system_prompt,
|
@@ -860,7 +860,7 @@ class Chatbot(gr.Chatbot):
|
|
860 |
raise TypeError(
|
861 |
f"Expected a list of lists of length 2 or list of tuples of length 2. Received: {message_pair}"
|
862 |
)
|
863 |
-
result = result.replace('؛','\n').replace('/','
|
864 |
result = result[:result.rfind('\n')] # filter till the end verse, do not publish not complete verses
|
865 |
|
866 |
#print('Message Pairs: ',message_pair[0],message_pair[1], result)
|
|
|
567 |
prompt += f"{user_prompt}"
|
568 |
prompt += f"{bot_response}"
|
569 |
prompt += f"""{message}"""
|
570 |
+
return prompt.replace('\n','؛').replace('\t','/').replace(' * ','/').strip()
|
571 |
|
572 |
def generate(
|
573 |
prompt, history, system_prompt,
|
|
|
860 |
raise TypeError(
|
861 |
f"Expected a list of lists of length 2 or list of tuples of length 2. Received: {message_pair}"
|
862 |
)
|
863 |
+
result = result.replace('؛','\n').replace('/',' * ').strip()
|
864 |
result = result[:result.rfind('\n')] # filter till the end verse, do not publish not complete verses
|
865 |
|
866 |
#print('Message Pairs: ',message_pair[0],message_pair[1], result)
|