Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,7 +142,7 @@ def process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sec
|
|
| 142 |
# doc.save(file_name)
|
| 143 |
# return file_name
|
| 144 |
|
| 145 |
-
def save_markdown_to_word(markdown_text, file_name):
|
| 146 |
# Create a new Document
|
| 147 |
doc = Document()
|
| 148 |
|
|
@@ -195,7 +195,7 @@ def main_interface(uploaded_files, name, number_of_sections, difficulty_level, *
|
|
| 195 |
calculated_marks = sum(section['num_questions'] * section['marks_per_question'] for section in sections)
|
| 196 |
|
| 197 |
response = process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sections, sections, difficulty_level, calculated_marks)
|
| 198 |
-
word_file = save_markdown_to_word(response.text, f"{name}.docx")
|
| 199 |
return response.text, word_file
|
| 200 |
|
| 201 |
|
|
|
|
| 142 |
# doc.save(file_name)
|
| 143 |
# return file_name
|
| 144 |
|
| 145 |
+
def save_markdown_to_word(markdown_text, name, file_name):
|
| 146 |
# Create a new Document
|
| 147 |
doc = Document()
|
| 148 |
|
|
|
|
| 195 |
calculated_marks = sum(section['num_questions'] * section['marks_per_question'] for section in sections)
|
| 196 |
|
| 197 |
response = process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sections, sections, difficulty_level, calculated_marks)
|
| 198 |
+
word_file = save_markdown_to_word(response.text, name, f"{name}.docx")
|
| 199 |
return response.text, word_file
|
| 200 |
|
| 201 |
|