Spaces:
Sleeping
Sleeping
Push Bot
commited on
Commit
Β·
366a959
1
Parent(s):
a91574d
Preview-only image: hide all PDF HTML previews; debug flows return only PDF path; pipeline stops building PDF HTML
Browse files
app.py
CHANGED
|
@@ -903,9 +903,8 @@ def debug_compile_last_pipeline_zip():
|
|
| 903 |
None,
|
| 904 |
)
|
| 905 |
try:
|
| 906 |
-
html = _pdf_preview_html(pdf_path, height="700px")
|
| 907 |
_write_logs(LOG_PATH, logs)
|
| 908 |
-
return
|
| 909 |
except Exception as e:
|
| 910 |
logs.append(f"β οΈ preview failed: {e}")
|
| 911 |
_write_logs(LOG_PATH, logs)
|
|
@@ -1007,9 +1006,8 @@ def debug_compile_uploaded_zip(zip_file):
|
|
| 1007 |
None,
|
| 1008 |
)
|
| 1009 |
try:
|
| 1010 |
-
html = _pdf_preview_html(pdf_path, height="700px")
|
| 1011 |
_write_logs(LOG_PATH, logs)
|
| 1012 |
-
return
|
| 1013 |
except Exception as e:
|
| 1014 |
logs.append(f"β οΈ preview failed: {e}")
|
| 1015 |
_write_logs(LOG_PATH, logs)
|
|
@@ -1211,17 +1209,16 @@ def run_pipeline(arxiv_url, pdf_file, openai_key, logo_files, meeting_logo_file,
|
|
| 1211 |
_write_logs(LOG_PATH, logs)
|
| 1212 |
yield "\n".join(logs), "", None, None, ""
|
| 1213 |
|
| 1214 |
-
# ====== Compile PDF (for
|
| 1215 |
pdf_html = ""
|
| 1216 |
compiled_pdf_file = None
|
| 1217 |
try:
|
| 1218 |
pdf_path = _compile_poster_pdf(OUTPUT_DIR, logs)
|
| 1219 |
if pdf_path and pdf_path.exists():
|
| 1220 |
-
pdf_html = _pdf_preview_html(pdf_path)
|
| 1221 |
compiled_pdf_file = str(pdf_path)
|
| 1222 |
-
logs.append("π¨οΈ PDF
|
| 1223 |
except Exception as e:
|
| 1224 |
-
logs.append(f"β οΈ PDF compile
|
| 1225 |
|
| 1226 |
# ====== Zip output (run-local) ======
|
| 1227 |
try:
|
|
@@ -1322,17 +1319,17 @@ The framework builds upon [CAMEL-ai](https://github.com/camel-ai/camel).
|
|
| 1322 |
with gr.Column(scale=1):
|
| 1323 |
with gr.Accordion("Output", open=True):
|
| 1324 |
logs_out = gr.Textbox(label="π§Ύ Logs (8β10 minutes)", lines=30, max_lines=50)
|
| 1325 |
-
pdf_out = gr.HTML(label="π Poster (PDF Preview)")
|
| 1326 |
img_out = gr.Image(label="πΌοΈ Poster (Image Preview)", interactive=False)
|
| 1327 |
pdf_file_out = gr.File(label="π Download Poster (PDF)")
|
| 1328 |
zip_out = gr.File(label="π¦ Download Results (.zip)")
|
| 1329 |
overleaf_out = gr.HTML(label="Open in Overleaf")
|
| 1330 |
debug_zip_btn= gr.Button("π Test repo output.zip", variant="secondary")
|
| 1331 |
-
debug_zip_out= gr.HTML(label="π Real Output Preview")
|
| 1332 |
debug_zip_img= gr.Image(label="π Real Output Image", interactive=False)
|
| 1333 |
debug_zip_pdfpath = gr.Textbox(visible=False)
|
| 1334 |
debug_last_btn= gr.Button("π Test last pipeline zip", variant="secondary")
|
| 1335 |
-
debug_last_out= gr.HTML(label="π Last Pipeline Preview")
|
| 1336 |
debug_last_img= gr.Image(label="π Last Output Image", interactive=False)
|
| 1337 |
debug_last_pdfpath = gr.Textbox(visible=False)
|
| 1338 |
_run_evt = run_btn.click(
|
|
|
|
| 903 |
None,
|
| 904 |
)
|
| 905 |
try:
|
|
|
|
| 906 |
_write_logs(LOG_PATH, logs)
|
| 907 |
+
return "", str(pdf_path)
|
| 908 |
except Exception as e:
|
| 909 |
logs.append(f"β οΈ preview failed: {e}")
|
| 910 |
_write_logs(LOG_PATH, logs)
|
|
|
|
| 1006 |
None,
|
| 1007 |
)
|
| 1008 |
try:
|
|
|
|
| 1009 |
_write_logs(LOG_PATH, logs)
|
| 1010 |
+
return "", str(pdf_path)
|
| 1011 |
except Exception as e:
|
| 1012 |
logs.append(f"β οΈ preview failed: {e}")
|
| 1013 |
_write_logs(LOG_PATH, logs)
|
|
|
|
| 1209 |
_write_logs(LOG_PATH, logs)
|
| 1210 |
yield "\n".join(logs), "", None, None, ""
|
| 1211 |
|
| 1212 |
+
# ====== Compile PDF (for download + image preview) ======
|
| 1213 |
pdf_html = ""
|
| 1214 |
compiled_pdf_file = None
|
| 1215 |
try:
|
| 1216 |
pdf_path = _compile_poster_pdf(OUTPUT_DIR, logs)
|
| 1217 |
if pdf_path and pdf_path.exists():
|
|
|
|
| 1218 |
compiled_pdf_file = str(pdf_path)
|
| 1219 |
+
logs.append("π¨οΈ PDF compiled (image preview available).")
|
| 1220 |
except Exception as e:
|
| 1221 |
+
logs.append(f"β οΈ PDF compile skipped: {e}")
|
| 1222 |
|
| 1223 |
# ====== Zip output (run-local) ======
|
| 1224 |
try:
|
|
|
|
| 1319 |
with gr.Column(scale=1):
|
| 1320 |
with gr.Accordion("Output", open=True):
|
| 1321 |
logs_out = gr.Textbox(label="π§Ύ Logs (8β10 minutes)", lines=30, max_lines=50)
|
| 1322 |
+
pdf_out = gr.HTML(label="π Poster (PDF Preview)", visible=False)
|
| 1323 |
img_out = gr.Image(label="πΌοΈ Poster (Image Preview)", interactive=False)
|
| 1324 |
pdf_file_out = gr.File(label="π Download Poster (PDF)")
|
| 1325 |
zip_out = gr.File(label="π¦ Download Results (.zip)")
|
| 1326 |
overleaf_out = gr.HTML(label="Open in Overleaf")
|
| 1327 |
debug_zip_btn= gr.Button("π Test repo output.zip", variant="secondary")
|
| 1328 |
+
debug_zip_out= gr.HTML(label="π Real Output Preview", visible=False)
|
| 1329 |
debug_zip_img= gr.Image(label="π Real Output Image", interactive=False)
|
| 1330 |
debug_zip_pdfpath = gr.Textbox(visible=False)
|
| 1331 |
debug_last_btn= gr.Button("π Test last pipeline zip", variant="secondary")
|
| 1332 |
+
debug_last_out= gr.HTML(label="π Last Pipeline Preview", visible=False)
|
| 1333 |
debug_last_img= gr.Image(label="π Last Output Image", interactive=False)
|
| 1334 |
debug_last_pdfpath = gr.Textbox(visible=False)
|
| 1335 |
_run_evt = run_btn.click(
|