Update app.py
Browse files
app.py
CHANGED
|
@@ -136,25 +136,6 @@ if st.button("🔮 Predict Sepsis"):
|
|
| 136 |
# Display the DataFrame
|
| 137 |
st.table(input_df)
|
| 138 |
|
| 139 |
-
# Download Button Section
|
| 140 |
-
st.subheader("Download Prediction")
|
| 141 |
-
patient_name = st.text_input("Enter the patient's name:")
|
| 142 |
-
if st.button("Download Prediction"):
|
| 143 |
-
if patient_name:
|
| 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 button
|
| 152 |
-
with open(file_path, "rb") as file:
|
| 153 |
-
st.download_button(label=f"Download {patient_name}'s Prediction CSV", data=file, key="download_button")
|
| 154 |
-
|
| 155 |
-
else:
|
| 156 |
-
st.warning("Please enter the patient's name.")
|
| 157 |
-
|
| 158 |
except Exception as e:
|
| 159 |
st.error(f"An error occurred: {e}")
|
| 160 |
|
|
|
|
| 136 |
# Display the DataFrame
|
| 137 |
st.table(input_df)
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
except Exception as e:
|
| 140 |
st.error(f"An error occurred: {e}")
|
| 141 |
|