Spaces:
Runtime error
Runtime error
Commit
·
65850ba
1
Parent(s):
eb8cf92
delete word_list
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from datasets import load_dataset
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
import re
|
|
@@ -9,15 +9,15 @@ from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
|
| 9 |
|
| 10 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 11 |
|
| 12 |
-
word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt")
|
| 13 |
-
word_list = word_list_dataset["train"]['text']
|
| 14 |
|
| 15 |
-
is_gpu_busy =
|
| 16 |
def infer(prompt, negative, scale):
|
| 17 |
global is_gpu_busy
|
| 18 |
-
for filter in word_list:
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
images = []
|
| 23 |
# url = os.getenv('JAX_BACKEND_URL')
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
# from datasets import load_dataset
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
import re
|
|
|
|
| 9 |
|
| 10 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 11 |
|
| 12 |
+
# word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt")
|
| 13 |
+
# word_list = word_list_dataset["train"]['text']
|
| 14 |
|
| 15 |
+
is_gpu_busy = True
|
| 16 |
def infer(prompt, negative, scale):
|
| 17 |
global is_gpu_busy
|
| 18 |
+
# for filter in word_list:
|
| 19 |
+
# if re.search(rf"\b{filter}\b", prompt):
|
| 20 |
+
# raise gr.Error("Unsafe content found. Please try again with different prompts.")
|
| 21 |
|
| 22 |
images = []
|
| 23 |
# url = os.getenv('JAX_BACKEND_URL')
|