Spaces:
Sleeping
Sleeping
Commit ·
4113d0e
1
Parent(s): 6cc3271
fix: parse dictionary response from fallback API
Browse files
app.py
CHANGED
|
@@ -167,6 +167,10 @@ def generate_3d_model(image: Image.Image, with_texture: bool = True, use_local:
|
|
| 167 |
final_model_path = result[0]
|
| 168 |
else:
|
| 169 |
final_model_path = result
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
debug_logs.append(f"Remote API success: {final_model_path}")
|
| 172 |
return final_model_path, final_model_path, "\n".join(debug_logs)
|
|
|
|
| 167 |
final_model_path = result[0]
|
| 168 |
else:
|
| 169 |
final_model_path = result
|
| 170 |
+
|
| 171 |
+
# Parse dictionary return (e.g. {'value': path, '__type__': 'update'})
|
| 172 |
+
if isinstance(final_model_path, dict) and 'value' in final_model_path:
|
| 173 |
+
final_model_path = final_model_path['value']
|
| 174 |
|
| 175 |
debug_logs.append(f"Remote API success: {final_model_path}")
|
| 176 |
return final_model_path, final_model_path, "\n".join(debug_logs)
|