Update app.py
Browse files
app.py
CHANGED
@@ -91,10 +91,11 @@ def generate_prompt_response(persona_prompt: str, prompt: str) -> dict:
|
|
91 |
)
|
92 |
generated_text = pipe(persona_prompt + user_prompt)[0]['generated_text']
|
93 |
|
94 |
-
|
95 |
-
assistant_response = generated_text.
|
96 |
-
|
97 |
-
|
|
|
98 |
|
99 |
except Exception as e:
|
100 |
# Handle any exceptions and return an error message
|
|
|
91 |
)
|
92 |
generated_text = pipe(persona_prompt + user_prompt)[0]['generated_text']
|
93 |
|
94 |
+
# Remove the "ASSISTANT:" prefix from the generated text
|
95 |
+
assistant_response = generated_text.replace("ASSISTANT:", "").strip()
|
96 |
+
|
97 |
+
# Return the user prompt and assistant's response as a dictionary
|
98 |
+
return {"user": prompt, "assistant": assistant_response}
|
99 |
|
100 |
except Exception as e:
|
101 |
# Handle any exceptions and return an error message
|