Spaces:
Running on CPU Upgrade

multimodalart HF staff commited on
Commit
a8e6836
1 Parent(s): 6ea3280

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from datasets import load_dataset
3
 
4
  import base64
@@ -15,6 +16,8 @@ from share_btn import community_icon_html, loading_icon_html, share_js
15
  word_list_dataset = load_dataset("google/word-list-sd", data_files="list.txt", use_auth_token=True)
16
  word_list = word_list_dataset["train"]['text']
17
 
 
 
18
  def infer(prompt, negative="low_quality", scale=7, profile: gr.OAuthProfile | None = None):
19
  for filter in word_list:
20
  if re.search(rf"\b{filter}\b", prompt):
 
1
  import gradio as gr
2
+ import gradio.helpers
3
  from datasets import load_dataset
4
 
5
  import base64
 
16
  word_list_dataset = load_dataset("google/word-list-sd", data_files="list.txt", use_auth_token=True)
17
  word_list = word_list_dataset["train"]['text']
18
 
19
+ gradio.helpers.CACHE_FOLDER="/data/cache"
20
+
21
  def infer(prompt, negative="low_quality", scale=7, profile: gr.OAuthProfile | None = None):
22
  for filter in word_list:
23
  if re.search(rf"\b{filter}\b", prompt):