Update app.py
Browse files
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
|
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": "
|
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 |
|