Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,21 +73,20 @@ elif choice == "Summarize Textbook":
|
|
| 73 |
|
| 74 |
elif choice == "Generate own book":
|
| 75 |
st.subheader("Create your own book")
|
| 76 |
-
st.caption('
|
| 77 |
-
book_name = st.text_input("textbook
|
| 78 |
if book_name:
|
| 79 |
button = st.button("Generate Book")
|
| 80 |
if book_name and button:
|
| 81 |
with st.spinner('creating...'):
|
| 82 |
response = model.book_creator(book_name)
|
| 83 |
-
st.write(response)
|
| 84 |
response = response.replace("```html", "")
|
| 85 |
response = response.replace("```", "")
|
| 86 |
|
| 87 |
pdf_bytes = roadmap_generator.pdf_creator(response)
|
| 88 |
-
st.success("
|
| 89 |
|
| 90 |
-
st.download_button("Download
|
| 91 |
|
| 92 |
elif choice == "Image To Notes":
|
| 93 |
st.subheader("Image To Notes")
|
|
|
|
| 73 |
|
| 74 |
elif choice == "Generate own book":
|
| 75 |
st.subheader("Create your own book")
|
| 76 |
+
st.caption('write your book name our AI will create book for you')
|
| 77 |
+
book_name = st.text_input("textbook Name")
|
| 78 |
if book_name:
|
| 79 |
button = st.button("Generate Book")
|
| 80 |
if book_name and button:
|
| 81 |
with st.spinner('creating...'):
|
| 82 |
response = model.book_creator(book_name)
|
|
|
|
| 83 |
response = response.replace("```html", "")
|
| 84 |
response = response.replace("```", "")
|
| 85 |
|
| 86 |
pdf_bytes = roadmap_generator.pdf_creator(response)
|
| 87 |
+
st.success("Own Book generated successfully!")
|
| 88 |
|
| 89 |
+
st.download_button("Download Book", data=pdf_bytes, file_name="output.pdf", mime="application/pdf")
|
| 90 |
|
| 91 |
elif choice == "Image To Notes":
|
| 92 |
st.subheader("Image To Notes")
|