MindVR commited on
Commit
1e99ca6
·
verified ·
1 Parent(s): 26c2d7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- return response
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!")