Manikandan-Alagu commited on
Commit
f958fdb
·
verified ·
1 Parent(s): 51cfffb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -17,7 +17,7 @@ with open('Response.json', 'r') as file:
17
 
18
  st.title("MCQs Creator Application")
19
 
20
- with st.markdown("user_inputs"):
21
  uploader_file = st.file_uploader("Upload a PDF or Txt file")
22
  mcq_count = st.text_input("No. of MCQS")
23
  subject = st.text_input("Insert subject", max_chars=20)
@@ -63,18 +63,19 @@ with st.markdown("user_inputs"):
63
  else:
64
  st.write(response)
65
 
66
- csv = st.download_button(
67
- label="Download as CSV",
68
- data=df.to_csv(index=False).encode("utf-8"),
69
- file_name=csv_filename,
70
- key="csv-download",
71
- )
 
72
 
73
- pdf = st.download_button(
74
- label="Download as PDF",
75
- data=df.to_html().encode("utf-8"),
76
- file_name=pdf_filename,
77
- key="pdf-download",
78
- )
79
 
80
 
 
17
 
18
  st.title("MCQs Creator Application")
19
 
20
+ with st.form("user_inputs"):
21
  uploader_file = st.file_uploader("Upload a PDF or Txt file")
22
  mcq_count = st.text_input("No. of MCQS")
23
  subject = st.text_input("Insert subject", max_chars=20)
 
63
  else:
64
  st.write(response)
65
 
66
+ if button:
67
+ csv = st.download_button(
68
+ label="Download as CSV",
69
+ data=df.to_csv(index=False).encode("utf-8"),
70
+ file_name=csv_filename,
71
+ key="csv-download",
72
+ )
73
 
74
+ pdf = st.download_button(
75
+ label="Download as PDF",
76
+ data=df.to_html().encode("utf-8"),
77
+ file_name=pdf_filename,
78
+ key="pdf-download",
79
+ )
80
 
81