Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,8 +58,12 @@ def medical_assistant_interaction(pulse_rate, blood_pressure_systolic, blood_pre
|
|
| 58 |
messages=[{"content": response_text}],
|
| 59 |
#max_output_tokens=150
|
| 60 |
)
|
| 61 |
-
assistant_message = response.last['content'].strip()
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
# Combine the assistant's message with the model's prediction
|
| 64 |
if prediction == 1:
|
| 65 |
model_inference = "Based on the sensor readings, the classifier suggests a high likelihood of Lassa fever."
|
|
|
|
| 58 |
messages=[{"content": response_text}],
|
| 59 |
#max_output_tokens=150
|
| 60 |
)
|
| 61 |
+
#assistant_message = response.last['content'].strip()
|
| 62 |
+
if 'candidates' in response:
|
| 63 |
+
assistant_message = response['candidates'][0]['content'].strip()
|
| 64 |
+
else:
|
| 65 |
+
assistant_message = "Error: No valid response from the model."
|
| 66 |
+
|
| 67 |
# Combine the assistant's message with the model's prediction
|
| 68 |
if prediction == 1:
|
| 69 |
model_inference = "Based on the sensor readings, the classifier suggests a high likelihood of Lassa fever."
|