Update app.py
Browse files
app.py
CHANGED
|
@@ -73,16 +73,16 @@ def respond(message, history):
|
|
| 73 |
response += token
|
| 74 |
yield response
|
| 75 |
|
| 76 |
-
if len(response) > char_limit:
|
| 77 |
-
|
| 78 |
|
| 79 |
-
for punc in [".", "!", "?"]:
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
|
| 85 |
-
yield response
|
| 86 |
|
| 87 |
chatbot = gr.ChatInterface(respond, type="messages")
|
| 88 |
|
|
|
|
| 73 |
response += token
|
| 74 |
yield response
|
| 75 |
|
| 76 |
+
# if len(response) > char_limit:
|
| 77 |
+
# response = response[:char_limit]
|
| 78 |
|
| 79 |
+
# for punc in [".", "!", "?"]:
|
| 80 |
+
# i = response.rfind(punc)
|
| 81 |
+
# if i != -1:
|
| 82 |
+
# response = response[:i+1]
|
| 83 |
+
# break
|
| 84 |
|
| 85 |
+
# yield response
|
| 86 |
|
| 87 |
chatbot = gr.ChatInterface(respond, type="messages")
|
| 88 |
|