Spaces:
Running on Zero
Running on Zero
Clarify content-filter message: classifiers included by default in the Microsoft Mage Flow model
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def _blocked_image(reason_text: str, height: int = 1024, width: int = 1024) -> I
|
|
| 45 |
font = ImageFont.load_default()
|
| 46 |
|
| 47 |
message = (
|
| 48 |
-
"The classifiers flagged the following:\n\n" + reason_text
|
| 49 |
)
|
| 50 |
|
| 51 |
# Wrap each paragraph to a column width that fits the image.
|
|
@@ -111,7 +111,7 @@ def generate(
|
|
| 111 |
verdict = pipe_edit.model.txt_enc.screen_edit(prompt, refs)
|
| 112 |
if verdict.violates:
|
| 113 |
reason_text = _block_reason_text(verdict)
|
| 114 |
-
gr.Warning("The classifiers flagged the following: " + reason_text)
|
| 115 |
w, h = refs[0].size
|
| 116 |
return _blocked_image(reason_text, height=h, width=w)
|
| 117 |
|
|
@@ -132,7 +132,7 @@ def generate(
|
|
| 132 |
verdict = pipe_t2i.model.txt_enc.screen_text(prompt)
|
| 133 |
if verdict.violates:
|
| 134 |
reason_text = _block_reason_text(verdict)
|
| 135 |
-
gr.Warning("The classifiers flagged the following: " + reason_text)
|
| 136 |
return _blocked_image(reason_text, height=int(height), width=int(width))
|
| 137 |
|
| 138 |
img = pipe_t2i.generate(
|
|
|
|
| 45 |
font = ImageFont.load_default()
|
| 46 |
|
| 47 |
message = (
|
| 48 |
+
"The classifiers included by default in the Microsoft Mage Flow model flagged the following:\n\n" + reason_text
|
| 49 |
)
|
| 50 |
|
| 51 |
# Wrap each paragraph to a column width that fits the image.
|
|
|
|
| 111 |
verdict = pipe_edit.model.txt_enc.screen_edit(prompt, refs)
|
| 112 |
if verdict.violates:
|
| 113 |
reason_text = _block_reason_text(verdict)
|
| 114 |
+
gr.Warning("The classifiers included by default in the Microsoft Mage Flow model flagged the following: " + reason_text)
|
| 115 |
w, h = refs[0].size
|
| 116 |
return _blocked_image(reason_text, height=h, width=w)
|
| 117 |
|
|
|
|
| 132 |
verdict = pipe_t2i.model.txt_enc.screen_text(prompt)
|
| 133 |
if verdict.violates:
|
| 134 |
reason_text = _block_reason_text(verdict)
|
| 135 |
+
gr.Warning("The classifiers included by default in the Microsoft Mage Flow model flagged the following: " + reason_text)
|
| 136 |
return _blocked_image(reason_text, height=int(height), width=int(width))
|
| 137 |
|
| 138 |
img = pipe_t2i.generate(
|