Spaces:
Build error
Build error
PatrickSchrML
commited on
Commit
•
d52c627
1
Parent(s):
b078ea5
error message
Browse files
app.py
CHANGED
@@ -47,7 +47,8 @@ def infer(prompt, n_samples, steps, scale, seed):
|
|
47 |
if 'output' not in data:
|
48 |
raise gr.Error("Although safety guidance is enabled, potential unsafe content found. Please try again with different seed.")
|
49 |
else:
|
50 |
-
if data['output']['result_type']
|
|
|
51 |
for image in data['output']['choices']:
|
52 |
im = Image.open(BytesIO(base64.b64decode(image['image_base64'])))
|
53 |
images.append(im)
|
|
|
47 |
if 'output' not in data:
|
48 |
raise gr.Error("Although safety guidance is enabled, potential unsafe content found. Please try again with different seed.")
|
49 |
else:
|
50 |
+
if data['output']['result_type'] == "error":
|
51 |
+
raise gr.Error(data['output']['value'])
|
52 |
for image in data['output']['choices']:
|
53 |
im = Image.open(BytesIO(base64.b64decode(image['image_base64'])))
|
54 |
images.append(im)
|