Vitrous commited on
Commit
6113bd1
·
verified ·
1 Parent(s): 17247a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -129,8 +129,12 @@ def hermes_generate_response(msg_prompt: str) -> dict:
129
  '''
130
  pipe_output = pipe(prompt_template)[0]['generated_text']
131
  #assistant_reply = pipe_output.split('\n\n')[1]
 
 
 
132
 
133
- return {"user": msg_prompt, "assistant": pipe_output}
 
134
  except Exception as e:
135
  return {"error": str(e)}
136
 
 
129
  '''
130
  pipe_output = pipe(prompt_template)[0]['generated_text']
131
  #assistant_reply = pipe_output.split('\n\n')[1]
132
+ # Separate user's prompt and assistant's response
133
+ response_lines = pipe_output.split('\n\n')
134
+ assistant_response = response_lines[-1].strip() # Get the last line
135
 
136
+
137
+ return {"user": msg_prompt, "assistant": assistant_response}
138
  except Exception as e:
139
  return {"error": str(e)}
140