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
Files changed (1) hide show
  1. app.py +8 -11
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 html, str(pdf_path)
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 html, str(pdf_path)
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 inline preview) ======
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 ready for preview in UI.")
1223
  except Exception as e:
1224
- logs.append(f"⚠️ PDF compile/preview skipped: {e}")
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(