Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def export_to_excel(study_plan, filename="study_plan.xlsx"):
|
|
45 |
|
46 |
# Streamlit UI
|
47 |
st.title("Personalized Study Assistant Chatbot")
|
48 |
-
st.write("Generate a tailored study plan with actionable insights and
|
49 |
|
50 |
# Input fields
|
51 |
subject = st.text_input("Study Topic or Exam Subject", "IELTS")
|
@@ -58,19 +58,13 @@ if st.button("Generate Study Plan"):
|
|
58 |
st.subheader("Generated Study Plan")
|
59 |
st.text_area("Your Study Plan", study_plan, height=300)
|
60 |
|
61 |
-
#
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
with col2:
|
72 |
-
if st.button("Export to Excel"):
|
73 |
-
excel_file = export_to_excel(study_plan)
|
74 |
-
st.success(f"Study plan exported as {excel_file}")
|
75 |
-
with open(excel_file, "rb") as file:
|
76 |
-
st.download_button("Download Excel", file, file_name="study_plan.xlsx", key="excel_download")
|
|
|
45 |
|
46 |
# Streamlit UI
|
47 |
st.title("Personalized Study Assistant Chatbot")
|
48 |
+
st.write("Generate a tailored study plan with actionable insights and download options.")
|
49 |
|
50 |
# Input fields
|
51 |
subject = st.text_input("Study Topic or Exam Subject", "IELTS")
|
|
|
58 |
st.subheader("Generated Study Plan")
|
59 |
st.text_area("Your Study Plan", study_plan, height=300)
|
60 |
|
61 |
+
# File generation after study plan is created
|
62 |
+
pdf_file = export_to_pdf(study_plan)
|
63 |
+
excel_file = export_to_excel(study_plan)
|
64 |
+
|
65 |
+
# Create download buttons for both PDF and Excel
|
66 |
+
with open(pdf_file, "rb") as file:
|
67 |
+
st.download_button("Download PDF", file, file_name="study_plan.pdf", key="pdf_download")
|
68 |
+
|
69 |
+
with open(excel_file, "rb") as file:
|
70 |
+
st.download_button("Download Excel", file, file_name="study_plan.xlsx", key="excel_download")
|
|
|
|
|
|
|
|
|
|
|
|