Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,21 +133,22 @@ if st.button("Generate Questions"):
|
|
| 133 |
data.append((context, keyword, question))
|
| 134 |
|
| 135 |
# Export buttons
|
|
|
|
| 136 |
# if st.button("Export to CSV"):
|
| 137 |
# if downlaod_csv:
|
| 138 |
# csv_data = export_to_csv(data)
|
| 139 |
# st.success("Questions exported to questions.csv")
|
| 140 |
# st.download_button(label="Download CSV", data=csv_data, file_name='questions.csv', mime='text/csv')
|
| 141 |
-
|
| 142 |
-
|
| 143 |
|
| 144 |
# if st.button("Export to PDF"):
|
| 145 |
# if download_pdf:
|
| 146 |
# pdf_data = export_to_pdf(data)
|
| 147 |
# st.success("Questions exported to questions.pdf")
|
| 148 |
# st.download_button(label="Download PDF", data=pdf_data, file_name='questions.pdf', mime='application/pdf')
|
| 149 |
-
|
| 150 |
-
|
| 151 |
|
| 152 |
else:
|
| 153 |
st.write("Please enter some text to generate questions.")
|
|
|
|
| 133 |
data.append((context, keyword, question))
|
| 134 |
|
| 135 |
# Export buttons
|
| 136 |
+
if data is not None:
|
| 137 |
# if st.button("Export to CSV"):
|
| 138 |
# if downlaod_csv:
|
| 139 |
# csv_data = export_to_csv(data)
|
| 140 |
# st.success("Questions exported to questions.csv")
|
| 141 |
# st.download_button(label="Download CSV", data=csv_data, file_name='questions.csv', mime='text/csv')
|
| 142 |
+
csv_data = export_to_csv(data)
|
| 143 |
+
st.download_button(label="Download CSV", data=csv_data, file_name='questions.csv', mime='text/csv')
|
| 144 |
|
| 145 |
# if st.button("Export to PDF"):
|
| 146 |
# if download_pdf:
|
| 147 |
# pdf_data = export_to_pdf(data)
|
| 148 |
# st.success("Questions exported to questions.pdf")
|
| 149 |
# st.download_button(label="Download PDF", data=pdf_data, file_name='questions.pdf', mime='application/pdf')
|
| 150 |
+
pdf_data = export_to_pdf(data)
|
| 151 |
+
st.download_button(label="Download PDF", data=pdf_data, file_name='questions.pdf', mime='application/pdf')
|
| 152 |
|
| 153 |
else:
|
| 154 |
st.write("Please enter some text to generate questions.")
|