Spaces:
No application file
No application file
sam133
commited on
Commit
Β·
0acf28a
1
Parent(s):
44cdfaa
Fix schema validation and launch parameters
Browse files
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
|
| 63 |
-
|
| 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.
|
| 179 |
-
label="π§ Vehicle Parameters & Specifications",
|
| 180 |
-
|
|
|
|
|
|
|
| 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:
|