Spaces:
Runtime error
Runtime error
Update optim_utils.py
Browse files- optim_utils.py +1 -2
optim_utils.py
CHANGED
|
@@ -7,7 +7,6 @@ from statistics import mean
|
|
| 7 |
import copy
|
| 8 |
import json
|
| 9 |
from typing import Any, Mapping
|
| 10 |
-
from tqdm import tqdm
|
| 11 |
|
| 12 |
import open_clip
|
| 13 |
|
|
@@ -150,7 +149,7 @@ def optimize_prompt_loop(model, tokenizer, token_embedding, all_target_features,
|
|
| 150 |
best_sim = 0
|
| 151 |
best_text = ""
|
| 152 |
|
| 153 |
-
for step in
|
| 154 |
# randomly sample sample images and get features
|
| 155 |
if batch_size is None:
|
| 156 |
target_features = all_target_features
|
|
|
|
| 7 |
import copy
|
| 8 |
import json
|
| 9 |
from typing import Any, Mapping
|
|
|
|
| 10 |
|
| 11 |
import open_clip
|
| 12 |
|
|
|
|
| 149 |
best_sim = 0
|
| 150 |
best_text = ""
|
| 151 |
|
| 152 |
+
for step in range(opt_iters):
|
| 153 |
# randomly sample sample images and get features
|
| 154 |
if batch_size is None:
|
| 155 |
target_features = all_target_features
|