Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -183,10 +183,17 @@ with gr.Blocks(title=APP_TITLE) as demo:
|
|
| 183 |
ask_btn_a = gr.Button("Ask for Guidance")
|
| 184 |
ask_btn_a.click(mentorship_interface, [domain_a, audience_a, query_a, language_a], output_a)
|
| 185 |
|
| 186 |
-
# ------------------
|
| 187 |
download_btn_a = gr.Button("Download as DOCX")
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
|
| 192 |
# ---------------- Tab B ----------------
|
|
|
|
| 183 |
ask_btn_a = gr.Button("Ask for Guidance")
|
| 184 |
ask_btn_a.click(mentorship_interface, [domain_a, audience_a, query_a, language_a], output_a)
|
| 185 |
|
| 186 |
+
# ------------------ Download Button ------------------
|
| 187 |
download_btn_a = gr.Button("Download as DOCX")
|
| 188 |
+
download_file_a = gr.File(label="Download Report")
|
| 189 |
+
|
| 190 |
+
# Function returns the file path for direct download
|
| 191 |
+
def download_docx_direct(text):
|
| 192 |
+
path = save_docx_with_letterhead(text)
|
| 193 |
+
return path
|
| 194 |
+
|
| 195 |
+
download_btn_a.click(download_docx_direct, inputs=[output_a], outputs=[download_file_a])
|
| 196 |
+
|
| 197 |
|
| 198 |
|
| 199 |
# ---------------- Tab B ----------------
|