sam133 commited on
Commit
9f19a03
·
1 Parent(s): 510f9b3

� CRITICAL FIX: Add missing value parameters to fix Gradio schema error

Browse files

❌ Fixed: TypeError: argument of type 'bool' is not iterable
✅ Added proper initial values to all Gradio components:
- gr.JSON components now have value={}
- gr.Slider has value=0
- gr.Image has value=None
- gr.Markdown has value=
- gr.Textbox has value=
- gr.File has value=None
✅ Updated Gradio to >=4.44.1 for latest bug fixes

This resolves the JSON schema validation error during API info generation.

Files changed (2) hide show
  1. app.py +16 -8
  2. requirements.txt +1 -1
app.py CHANGED
@@ -359,12 +359,14 @@ def create_agent2robot_interface():
359
  interactive=False,
360
  show_copy_button=True,
361
  elem_classes=["process-log"],
362
- placeholder="Process log will appear here in real-time as the AI agent works..."
 
363
  )
364
 
365
  with gr.Row():
366
  current_design_specs_output = gr.JSON(
367
- label="⚙️ Current Design Specs Being Tested"
 
368
  )
369
 
370
  progress_bar_output = gr.Slider(
@@ -373,7 +375,8 @@ def create_agent2robot_interface():
373
  step=1,
374
  label="Progress (%)",
375
  interactive=False,
376
- show_label=True
 
377
  )
378
 
379
  # Results Section
@@ -388,31 +391,36 @@ def create_agent2robot_interface():
388
  simulation_video_output = gr.Image(
389
  label="🎬 Simulation of Best Design's Trial",
390
  interactive=False,
391
- height=300
 
392
  )
393
 
394
  performance_summary_output = gr.Markdown(
395
- label="📊 Performance Summary of Best Design"
 
396
  )
397
 
398
  with gr.Column(scale=1):
399
  best_design_specs_output = gr.JSON(
400
  label="🔩 Best Vehicle Design Specifications",
401
- show_label=True
 
402
  )
403
 
404
  download_json_output = gr.File(
405
  label="📄 Download Best Design Specs (JSON)",
406
  file_count="single",
407
  type="filepath",
408
- interactive=True
 
409
  )
410
 
411
  llm_rationale_output = gr.Textbox(
412
  label="💡 LLM's Design Rationale",
413
  lines=6,
414
  interactive=False,
415
- show_copy_button=True
 
416
  )
417
 
418
  # Connect button to the wrapper function
 
359
  interactive=False,
360
  show_copy_button=True,
361
  elem_classes=["process-log"],
362
+ placeholder="Process log will appear here in real-time as the AI agent works...",
363
+ value=""
364
  )
365
 
366
  with gr.Row():
367
  current_design_specs_output = gr.JSON(
368
+ label="⚙️ Current Design Specs Being Tested",
369
+ value={}
370
  )
371
 
372
  progress_bar_output = gr.Slider(
 
375
  step=1,
376
  label="Progress (%)",
377
  interactive=False,
378
+ show_label=True,
379
+ value=0
380
  )
381
 
382
  # Results Section
 
391
  simulation_video_output = gr.Image(
392
  label="🎬 Simulation of Best Design's Trial",
393
  interactive=False,
394
+ height=300,
395
+ value=None
396
  )
397
 
398
  performance_summary_output = gr.Markdown(
399
+ label="📊 Performance Summary of Best Design",
400
+ value=""
401
  )
402
 
403
  with gr.Column(scale=1):
404
  best_design_specs_output = gr.JSON(
405
  label="🔩 Best Vehicle Design Specifications",
406
+ show_label=True,
407
+ value={}
408
  )
409
 
410
  download_json_output = gr.File(
411
  label="📄 Download Best Design Specs (JSON)",
412
  file_count="single",
413
  type="filepath",
414
+ interactive=True,
415
+ value=None
416
  )
417
 
418
  llm_rationale_output = gr.Textbox(
419
  label="💡 LLM's Design Rationale",
420
  lines=6,
421
  interactive=False,
422
+ show_copy_button=True,
423
+ value=""
424
  )
425
 
426
  # Connect button to the wrapper function
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  pybullet>=3.2.5
2
- gradio==4.44.1
3
  imageio>=2.20.0
4
  # transformers>=4.21.0
5
  # torch>=1.12.0
 
1
  pybullet>=3.2.5
2
+ gradio>=4.44.1
3
  imageio>=2.20.0
4
  # transformers>=4.21.0
5
  # torch>=1.12.0