Spaces:
Sleeping
Sleeping
Update app.py
Browse files237 unmodified lines238239240241242243244336 unmodified lines58158258358458558657 unmodified lines644645646647648237 unmodified linesprogress(0.8, desc="构建图结构中...")for line in iter(process_dag.stdout.readline, ''):full_log += lineyield create_progress_html(80, "⏳ Building Graph...", "active"), get_debug_info(session_id), full_log, no_change, no_change, no_change, no_changeprocess_dag.stdout.close()returncode_dag = process_dag.wait()336 unmodified lines# 4. Results & Downloadswith gr.Group(elem_classes="gradio-group"):gr.Markdown("### 📦 Generation Results & Download")download_file = gr.File(label="📥 Get Final Zip Archive", interactive=False, visible=False)# 5. Debugging57 unmodified linesrefresh_btn.click(fn=get_debug_info, inputs=[session_id_state], outputs=debug_view)if __name__ == "__main__":demo.queue(default_concurrency_limit=5).launch()237 unmodified lines238239240241242243244336 unmodified lines58158258358458558658758858959059159259359459559659759857 unmodified lines656657658659660661662663664665666667668669670237 unmodified linesprogress(0.8, desc="构建图结构中...")for line in iter(process_dag.stdout.readline, ''):full_log += lineyield create_progress_html(80, "⏳ Building DAG...", "active"), get_debug_info(session_id), full_log, no_change, no_change, no_change, no_changeprocess_dag.stdout.close()returncode_dag = process_dag.wait()336 unmodified lines# 4. Results & Downloadswith gr.Group(elem_classes="gradio-group"):gr.Markdown("### 📦 Generation Results & Download")# --- 新增:无输出时的美化空状态提示词 ---download_placeholder = gr.HTML('''<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 160px; border: 2px dashed rgba(192, 132, 252, 0.6); border-radius: 16px; background-color: rgba(250, 245, 255, 0.5); color: #9333EA; text-align: center; transition: all 0.3s ease;"><span style="font-size: 32px; margin-bottom: 8px;">📦</span><span style="font-weight: 600; font-size: 16px; margin-bottom: 4px;">Awaiting Generation</span><span style="font-size: 13px; color: #A855F7; opacity: 0.8;">Generated assets will appear here as a downloadable ZIP archive.</span></div>''')download_file = gr.File(label="📥 Get Final Zip Archive", interactive=False, visible=False)# 5. Debugging57 unmodified linesrefresh_btn.click(fn=get_debug_info, inputs=[session_id_state], outputs=debug_view)def toggle_empty_placeholder(file_val):# 如果获取到了文件(值不为空),就隐藏占位提示词;否则保持显示return gr.update(visible=(file_val is None))download_file.change(fn=toggle_empty_placeholder,inputs=[download_file],outputs=[download_placeholder])if __name__ == "__main__":demo.queue(default_concurrency_limit=5).launch()
app.py+23-1