Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
#16792
by
Juno360219
- opened
app.py
CHANGED
@@ -9,14 +9,7 @@ import requests
|
|
9 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
10 |
|
11 |
word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt", use_auth_token=True)
|
12 |
-
word_list =
|
13 |
-
|
14 |
-
is_gpu_busy = False
|
15 |
-
def infer(prompt, negative, scale):
|
16 |
-
global is_gpu_busy
|
17 |
-
for filter in word_list:
|
18 |
-
if re.search(rf"\b{filter}\b", prompt):
|
19 |
-
raise gr.Error("Unsafe content found. Please try again with different prompts.")
|
20 |
|
21 |
images = []
|
22 |
url = os.getenv('JAX_BACKEND_URL')
|
@@ -275,7 +268,7 @@ with block:
|
|
275 |
btn = gr.Button("Generate image").style(
|
276 |
margin=False,
|
277 |
rounded=(False, True, True, False),
|
278 |
-
full_width=
|
279 |
)
|
280 |
|
281 |
gallery = gr.Gallery(
|
|
|
9 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
10 |
|
11 |
word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt", use_auth_token=True)
|
12 |
+
word_list =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
images = []
|
15 |
url = os.getenv('JAX_BACKEND_URL')
|
|
|
268 |
btn = gr.Button("Generate image").style(
|
269 |
margin=False,
|
270 |
rounded=(False, True, True, False),
|
271 |
+
full_width=True,
|
272 |
)
|
273 |
|
274 |
gallery = gr.Gallery(
|