Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,9 +46,11 @@ def chat(
|
|
| 46 |
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 47 |
if "AI:" in output_text:
|
| 48 |
response = output_text.split("AI:")[-1].strip()
|
|
|
|
|
|
|
| 49 |
else:
|
| 50 |
response = output_text.strip()
|
| 51 |
-
|
| 52 |
|
| 53 |
with gr.Blocks() as demo:
|
| 54 |
gr.Markdown("# MindVR Therapy Chatbot\n\nDùng thử UI hoặc gọi API!")
|
|
|
|
| 46 |
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 47 |
if "AI:" in output_text:
|
| 48 |
response = output_text.split("AI:")[-1].strip()
|
| 49 |
+
if "User:" in response:
|
| 50 |
+
response = response.split("User:")[0].strip()
|
| 51 |
else:
|
| 52 |
response = output_text.strip()
|
| 53 |
+
|
| 54 |
|
| 55 |
with gr.Blocks() as demo:
|
| 56 |
gr.Markdown("# MindVR Therapy Chatbot\n\nDùng thử UI hoặc gọi API!")
|