rasyosef commited on
Commit
5b4a85e
1 Parent(s): 25721d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -27,7 +27,10 @@ def generate(prompt, chat_history, max_new_tokens):
27
  final_prompt += "Output:"
28
 
29
  generated_text = phi2(final_prompt, max_new_tokens=max_new_tokens)[0]["generated_text"]
30
- response = generated_text.split("Output:")[1].split("User:")[0]
 
 
 
31
 
32
  if "Assistant:" in response:
33
  response = response.split("Assistant:")[1].strip()
 
27
  final_prompt += "Output:"
28
 
29
  generated_text = phi2(final_prompt, max_new_tokens=max_new_tokens)[0]["generated_text"]
30
+ response = generated_text.split("Output:")[1]
31
+
32
+ if "User:" in response:
33
+ response = response.split("User:")[0]
34
 
35
  if "Assistant:" in response:
36
  response = response.split("Assistant:")[1].strip()