Spaces:
No application file
No application file
sam133
commited on
Commit
Β·
8615389
1
Parent(s):
0532aec
Debug Step 5: CRITICAL - Add JSON and File components
Browse files
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
-
Agent2Robot - Debug Step
|
| 4 |
"""
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
-
# Step
|
| 9 |
with gr.Blocks(
|
| 10 |
title="π€π Agent2Robot - MCP Hackathon 2024",
|
| 11 |
theme=gr.themes.Soft()
|
| 12 |
) as demo:
|
| 13 |
-
gr.Markdown("# Step
|
| 14 |
|
| 15 |
with gr.Row():
|
| 16 |
with gr.Column():
|
|
@@ -42,6 +42,44 @@ with gr.Blocks(
|
|
| 42 |
|
| 43 |
with gr.Column():
|
| 44 |
gr.Markdown("## Output Section")
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
demo.launch()
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
+
Agent2Robot - Debug Step 5: Add CRITICAL Output Components (JSON, File)
|
| 4 |
"""
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
+
# Step 5: Add CRITICAL output components - gr.JSON and gr.File
|
| 9 |
with gr.Blocks(
|
| 10 |
title="π€π Agent2Robot - MCP Hackathon 2024",
|
| 11 |
theme=gr.themes.Soft()
|
| 12 |
) as demo:
|
| 13 |
+
gr.Markdown("# Step 5: CRITICAL Output Components Test")
|
| 14 |
|
| 15 |
with gr.Row():
|
| 16 |
with gr.Column():
|
|
|
|
| 42 |
|
| 43 |
with gr.Column():
|
| 44 |
gr.Markdown("## Output Section")
|
| 45 |
+
|
| 46 |
+
# Regular textbox - should be safe
|
| 47 |
+
process_log = gr.Textbox(
|
| 48 |
+
label="Process Log",
|
| 49 |
+
lines=10,
|
| 50 |
+
interactive=False,
|
| 51 |
+
value="" # String - SAFE
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
# CRITICAL SECTION: Add JSON components
|
| 55 |
+
with gr.Row():
|
| 56 |
+
with gr.Column():
|
| 57 |
+
gr.Markdown("### Current Specs (JSON)")
|
| 58 |
+
# CRITICAL: gr.JSON - first instance
|
| 59 |
+
current_specs_output = gr.JSON(
|
| 60 |
+
label="Current Design",
|
| 61 |
+
value=None # CRITICAL: None instead of boolean
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
with gr.Column():
|
| 65 |
+
gr.Markdown("### Final Specs (JSON)")
|
| 66 |
+
# CRITICAL: gr.JSON - second instance
|
| 67 |
+
final_specs_output = gr.JSON(
|
| 68 |
+
label="Final Design",
|
| 69 |
+
value={} # CRITICAL: Empty dict instead of boolean
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
# CRITICAL SECTION: Add File component
|
| 73 |
+
with gr.Row():
|
| 74 |
+
with gr.Column():
|
| 75 |
+
gr.Markdown("### Download Section")
|
| 76 |
+
# CRITICAL: gr.File component
|
| 77 |
+
download_file_output = gr.File(
|
| 78 |
+
label="Download Specs",
|
| 79 |
+
file_count="single",
|
| 80 |
+
interactive=False,
|
| 81 |
+
visible=False,
|
| 82 |
+
value=None # CRITICAL: None instead of boolean
|
| 83 |
+
)
|
| 84 |
|
| 85 |
demo.launch()
|