Spaces:
Runtime error
Runtime error
fix: filter unfinished verses
Browse files
app.py
CHANGED
@@ -860,9 +860,11 @@ 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 |
processed_messages.append(
|
864 |
[
|
865 |
-
None,self._postprocess_chat_messages(
|
866 |
#self._postprocess_chat_messages(message_pair[1])),
|
867 |
]
|
868 |
)
|
|
|
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 |
processed_messages.append(
|
866 |
[
|
867 |
+
None,self._postprocess_chat_messages(result)
|
868 |
#self._postprocess_chat_messages(message_pair[1])),
|
869 |
]
|
870 |
)
|