Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,8 +42,8 @@ with gr.Blocks(css=css, title="ViPer Demo", theme=gr.themes.Base()) as demo:
|
|
| 42 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 43 |
|
| 44 |
|
| 45 |
-
word_list_dataset = load_dataset("EPFL-VILAB/4m-wordlist", data_files="list.txt", use_auth_token=True)
|
| 46 |
-
word_list = word_list_dataset["train"]['text']
|
| 47 |
|
| 48 |
bnb_config = BitsAndBytesConfig(
|
| 49 |
load_in_4bit=True,
|
|
@@ -505,11 +505,11 @@ with gr.Blocks(css=css, title="ViPer Demo", theme=gr.themes.Base()) as demo:
|
|
| 505 |
if vp_pos == "" and vp_neg == "":
|
| 506 |
slider = 0
|
| 507 |
|
| 508 |
-
for filter in word_list:
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
|
| 514 |
if vp_pos != "":
|
| 515 |
vp_pos = vp_pos.split(", ")
|
|
|
|
| 42 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 43 |
|
| 44 |
|
| 45 |
+
#word_list_dataset = load_dataset("EPFL-VILAB/4m-wordlist", data_files="list.txt", use_auth_token=True)
|
| 46 |
+
#word_list = word_list_dataset["train"]['text']
|
| 47 |
|
| 48 |
bnb_config = BitsAndBytesConfig(
|
| 49 |
load_in_4bit=True,
|
|
|
|
| 505 |
if vp_pos == "" and vp_neg == "":
|
| 506 |
slider = 0
|
| 507 |
|
| 508 |
+
#for filter in word_list:
|
| 509 |
+
# if re.search(rf"\b{filter}\b", prompt):
|
| 510 |
+
# raise gr.Error("Please try again with a different prompt")
|
| 511 |
+
# if re.search(rf"\b{filter}\b", vp_pos) or re.search(rf"\b{filter}\b", vp_neg):
|
| 512 |
+
# raise gr.Error("Please try again with a different visual preference")
|
| 513 |
|
| 514 |
if vp_pos != "":
|
| 515 |
vp_pos = vp_pos.split(", ")
|