Manikandan-Alagu commited on
Commit
4b7f9c9
·
verified ·
1 Parent(s): 38e13f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -64,6 +64,23 @@ with st.form("user_inputs"):
64
  st.table(df)
65
 
66
  st.text_area(label="Review",value=response["review"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  else:
68
  st.error("Error in the table date")
69
 
 
64
  st.table(df)
65
 
66
  st.text_area(label="Review",value=response["review"])
67
+
68
+ csv_filename = "generated_mcqs.csv"
69
+ st.download_button(
70
+ label="Download as CSV",
71
+ data=df.to_csv(index=False).encode("utf-8"),
72
+ file_name=csv_filename,
73
+ key="csv-download",
74
+ )
75
+
76
+ # Download Button for PDF
77
+ pdf_filename = "generated_mcqs.pdf"
78
+ st.download_button(
79
+ label="Download as PDF",
80
+ data=df.to_html().encode("utf-8"),
81
+ file_name=pdf_filename,
82
+ key="pdf-download",
83
+ )
84
  else:
85
  st.error("Error in the table date")
86