Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,12 +57,12 @@ Please generate the Gradio code based on the provided image, focusing on the mos
|
|
57 |
)
|
58 |
|
59 |
# Debug: Print relevant parts of the response
|
60 |
-
print("API Response
|
61 |
-
print("API Response Choices:", response.choices)
|
62 |
|
63 |
# Extract the generated code from the response
|
64 |
if response.choices and response.choices[0].message:
|
65 |
generated_code = response.choices[0].message.content
|
|
|
66 |
else:
|
67 |
return "Error: Unexpected response structure from the API."
|
68 |
|
|
|
57 |
)
|
58 |
|
59 |
# Debug: Print relevant parts of the response
|
60 |
+
print("API Response received. Content available:", bool(response.choices))
|
|
|
61 |
|
62 |
# Extract the generated code from the response
|
63 |
if response.choices and response.choices[0].message:
|
64 |
generated_code = response.choices[0].message.content
|
65 |
+
print("Generated code length:", len(generated_code))
|
66 |
else:
|
67 |
return "Error: Unexpected response structure from the API."
|
68 |
|