Update app.py
Browse files
app.py
CHANGED
@@ -62,11 +62,12 @@ def generate_response(prompt: str) -> str:
|
|
62 |
repetition_penalty=1.1
|
63 |
)
|
64 |
generated_text = pipe(prompt_template)[0]['generated_text']
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
def generate_prompt_response(persona_prompt: str, prompt: str) -> dict:
|
71 |
try:
|
72 |
# Validate inputs
|
|
|
62 |
repetition_penalty=1.1
|
63 |
)
|
64 |
generated_text = pipe(prompt_template)[0]['generated_text']
|
65 |
+
# Extract the user prompt and assistant's reply
|
66 |
+
assistant_response = generated_text.split(user_prompt)[-1].strip()
|
67 |
+
|
68 |
+
return {"user": prompt, "assistant": assistant_response}
|
69 |
|
70 |
+
|
|
|
|
|
|
|
71 |
def generate_prompt_response(persona_prompt: str, prompt: str) -> dict:
|
72 |
try:
|
73 |
# Validate inputs
|