Update app.py
Browse files
app.py
CHANGED
|
@@ -11,15 +11,15 @@ from share_btn import community_icon_html, loading_icon_html, share_js
|
|
| 11 |
import huggingface_hub
|
| 12 |
huggingface_hub.login(token="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")
|
| 13 |
|
| 14 |
-
word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt", use_auth_token=True)
|
| 15 |
-
word_list = word_list_dataset["train"]['text']
|
| 16 |
|
| 17 |
is_gpu_busy = False
|
| 18 |
def infer(prompt, negative, scale):
|
| 19 |
global is_gpu_busy
|
| 20 |
-
for filter in word_list:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
|
| 24 |
images = []
|
| 25 |
url = os.getenv('JAX_BACKEND_URL')
|
|
|
|
| 11 |
import huggingface_hub
|
| 12 |
huggingface_hub.login(token="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")
|
| 13 |
|
| 14 |
+
#word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt", use_auth_token=True)
|
| 15 |
+
#word_list = word_list_dataset["train"]['text']
|
| 16 |
|
| 17 |
is_gpu_busy = False
|
| 18 |
def infer(prompt, negative, scale):
|
| 19 |
global is_gpu_busy
|
| 20 |
+
#for filter in word_list:
|
| 21 |
+
# if re.search(rf"\b{filter}\b", prompt):
|
| 22 |
+
# raise gr.Error("Unsafe content found. Please try again with different prompts.")
|
| 23 |
|
| 24 |
images = []
|
| 25 |
url = os.getenv('JAX_BACKEND_URL')
|