Update app.py
Browse files
app.py
CHANGED
|
@@ -144,15 +144,16 @@ if st.button("🔮 Predict Sepsis"):
|
|
| 144 |
# Generate the heading
|
| 145 |
heading = f"Sepsis Status Prediction For {patient_name}"
|
| 146 |
|
| 147 |
-
# Save the DataFrame to a CSV file
|
| 148 |
-
|
| 149 |
-
|
|
|
|
| 150 |
# Provide a download link
|
| 151 |
-
st.markdown(f"### [Download {patient_name}'s Prediction CSV](
|
| 152 |
-
|
| 153 |
else:
|
| 154 |
st.warning("Please enter the patient's name.")
|
| 155 |
-
|
| 156 |
except Exception as e:
|
| 157 |
st.error(f"An error occurred: {e}")
|
| 158 |
|
|
|
|
| 144 |
# Generate the heading
|
| 145 |
heading = f"Sepsis Status Prediction For {patient_name}"
|
| 146 |
|
| 147 |
+
# Save the DataFrame to a CSV file in the /app directory
|
| 148 |
+
file_path = f"/app/{patient_name}_sepsis_prediction.csv"
|
| 149 |
+
input_df.to_csv(file_path, index=False, encoding='utf-8-sig')
|
| 150 |
+
|
| 151 |
# Provide a download link
|
| 152 |
+
st.markdown(f"### [Download {patient_name}'s Prediction CSV](sandbox:/app/{patient_name}_sepsis_prediction.csv)")
|
| 153 |
+
|
| 154 |
else:
|
| 155 |
st.warning("Please enter the patient's name.")
|
| 156 |
+
|
| 157 |
except Exception as e:
|
| 158 |
st.error(f"An error occurred: {e}")
|
| 159 |
|