Vitrous commited on
Commit
438bd0f
·
verified ·
1 Parent(s): 78cd3b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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
- return generated_text
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