sam133 commited on
Commit
0acf28a
Β·
1 Parent(s): 44cdfaa

Fix schema validation and launch parameters

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -6,6 +6,7 @@ Based on successful Step 4 but with simple return function
6
 
7
  import os
8
  import ssl
 
9
 
10
  # Multiple SSL fixes for Windows/conda environments
11
  try:
@@ -59,8 +60,8 @@ def simple_test_function(vehicle_type, user_description):
59
 
60
  Status: βœ… SUCCESS"""
61
 
62
- # JSON output as dictionary (works with Gradio 4.40.0)
63
- json_output = {
64
  "vehicle_type": vehicle_type,
65
  "description": user_description,
66
  "status": "completed",
@@ -76,6 +77,7 @@ Status: βœ… SUCCESS"""
76
  "Low battery warning"
77
  ]
78
  }
 
79
 
80
  progress_value = 100
81
  status_message = "πŸŽ‰ Design process completed successfully!"
@@ -175,9 +177,11 @@ def create_minimal_working_app():
175
  )
176
 
177
  with gr.Tab("βš™οΈ Technical Specifications"):
178
- specs_output = gr.JSON(
179
- label="πŸ”§ Vehicle Parameters & Specifications",
180
- value={}
 
 
181
  )
182
 
183
  progress_output = gr.Slider(
@@ -247,9 +251,7 @@ if __name__ == "__main__":
247
  show_error=True,
248
  inbrowser=True,
249
  quiet=False,
250
- debug=False,
251
- show_tips=True,
252
- enable_queue=True
253
  )
254
 
255
  except Exception as e:
 
6
 
7
  import os
8
  import ssl
9
+ import json
10
 
11
  # Multiple SSL fixes for Windows/conda environments
12
  try:
 
60
 
61
  Status: βœ… SUCCESS"""
62
 
63
+ # JSON output as formatted string (avoids schema validation issues)
64
+ json_data = {
65
  "vehicle_type": vehicle_type,
66
  "description": user_description,
67
  "status": "completed",
 
77
  "Low battery warning"
78
  ]
79
  }
80
+ json_output = json.dumps(json_data, indent=2)
81
 
82
  progress_value = 100
83
  status_message = "πŸŽ‰ Design process completed successfully!"
 
177
  )
178
 
179
  with gr.Tab("βš™οΈ Technical Specifications"):
180
+ specs_output = gr.Textbox(
181
+ label="πŸ”§ Vehicle Parameters & Specifications (JSON Format)",
182
+ lines=8,
183
+ value="",
184
+ interactive=False
185
  )
186
 
187
  progress_output = gr.Slider(
 
251
  show_error=True,
252
  inbrowser=True,
253
  quiet=False,
254
+ debug=False
 
 
255
  )
256
 
257
  except Exception as e: