Spaces:
Running
Running
Update app.py
Browse files
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]
|
|
|
|
|
|
|
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()
|