Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,13 +40,6 @@ def process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sec
|
|
| 40 |
if not os.path.exists(folder_path):
|
| 41 |
os.makedirs(folder_path)
|
| 42 |
|
| 43 |
-
# for file in uploaded_files:
|
| 44 |
-
# print(file)
|
| 45 |
-
# print(type(file))
|
| 46 |
-
# with open(os.path.join(folder_path, file.name), "wb") as f:
|
| 47 |
-
# # f.write(file.read())
|
| 48 |
-
# with open(file, "rb") as input_file:
|
| 49 |
-
# f.write(input_file.read())
|
| 50 |
|
| 51 |
# Save uploaded files locally
|
| 52 |
for file in uploaded_files:
|
|
@@ -132,15 +125,6 @@ def process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sec
|
|
| 132 |
|
| 133 |
return response
|
| 134 |
|
| 135 |
-
# # Function to save the generated question paper to a Word document
|
| 136 |
-
# def save_to_word(text, file_name):
|
| 137 |
-
# doc = Document()
|
| 138 |
-
# doc.add_heading("Generated Question Paper", 0)
|
| 139 |
-
# lines = text.split('\n')
|
| 140 |
-
# for line in lines:
|
| 141 |
-
# doc.add_paragraph(line)
|
| 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
|
|
|
|
| 40 |
if not os.path.exists(folder_path):
|
| 41 |
os.makedirs(folder_path)
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
# Save uploaded files locally
|
| 45 |
for file in uploaded_files:
|
|
|
|
| 125 |
|
| 126 |
return response
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
def save_markdown_to_word(markdown_text, name, file_name):
|
| 130 |
# Create a new Document
|