leolaish commited on
Commit
eee493e
·
verified ·
1 Parent(s): 4cc4553

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -48,7 +48,7 @@ app = MyApp()
48
  def preprocess_input(user_input: str) -> str:
49
  """Preprocesses user input to enhance it for better context."""
50
  if "therapy" in user_input.lower() or "exercise" in user_input.lower():
51
- return "I am looking for guidance on therapy. Can you help me with some exercises or techniques to manage my stress and emotions?"
52
  return user_input
53
 
54
  def preprocess_response(response: str) -> str:
@@ -62,7 +62,7 @@ def preprocess_response(response: str) -> str:
62
 
63
  def shorten_response(response: str) -> str:
64
  """Uses the Zephyr model to shorten and refine the response."""
65
- messages = [{"role": "system", "content": "Shorten and refine this response."}, {"role": "user", "content": response}]
66
  result = client.chat_completion(messages, max_tokens=412, temperature=0.5, top_p=0.9)
67
  return result.choices[0].message['content'].strip()
68
 
 
48
  def preprocess_input(user_input: str) -> str:
49
  """Preprocesses user input to enhance it for better context."""
50
  if "therapy" in user_input.lower() or "exercise" in user_input.lower():
51
+ return "I am looking for guidance on treatment and health issues"
52
  return user_input
53
 
54
  def preprocess_response(response: str) -> str:
 
62
 
63
  def shorten_response(response: str) -> str:
64
  """Uses the Zephyr model to shorten and refine the response."""
65
+ messages = [{"role": "system", "content": "give a zeroshot clasiification on 'patient', 'student', 'kin and kinds' and give responce acoordingly. use vector data for disease related information."}, {"role": "user", "content": response}]
66
  result = client.chat_completion(messages, max_tokens=412, temperature=0.5, top_p=0.9)
67
  return result.choices[0].message['content'].strip()
68