daniloedu commited on
Commit
fa3d7a5
·
1 Parent(s): 0c9343c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -21,7 +21,8 @@ def respond(message, instruction="A conversation between a user and an AI assist
21
  prompt = format_chat_prompt(message, instruction)
22
  response = query({"inputs": prompt})
23
  generated_text = response[0]['generated_text']
24
- assistant_message = generated_text.split("Assistant:")[-1].strip()
 
25
  return assistant_message
26
 
27
  iface = gr.Interface(
 
21
  prompt = format_chat_prompt(message, instruction)
22
  response = query({"inputs": prompt})
23
  generated_text = response[0]['generated_text']
24
+ assistant_message = generated_text.split("Assistant:")[-1]
25
+ assistant_message = assistant_message.split("User:")[0].strip() # Only keep the text before the first "User:"
26
  return assistant_message
27
 
28
  iface = gr.Interface(