Spaces:
Running
Running
home
commited on
Commit
·
03240ea
1
Parent(s):
c26f308
Fix ModuleNotFoundError by adding defake to sys.path
Browse files- defake/test_api.py +2 -2
defake/test_api.py
CHANGED
|
@@ -44,11 +44,11 @@ def load_models(device=None):
|
|
| 44 |
blip = blip.to(device)
|
| 45 |
|
| 46 |
# 加载 finetuned CLIP
|
| 47 |
-
clip_finetuned = torch.load("finetune_clip.pt", map_location=device).to(device)
|
| 48 |
|
| 49 |
# 加载线性分类器
|
| 50 |
linear = NeuralNet(1024, [512, 256], 2).to(device)
|
| 51 |
-
linear = torch.load("clip_linear.pt", map_location=device).to(device)
|
| 52 |
linear.eval()
|
| 53 |
|
| 54 |
return {
|
|
|
|
| 44 |
blip = blip.to(device)
|
| 45 |
|
| 46 |
# 加载 finetuned CLIP
|
| 47 |
+
clip_finetuned = torch.load("finetune_clip.pt", map_location=device, weights_only=False).to(device)
|
| 48 |
|
| 49 |
# 加载线性分类器
|
| 50 |
linear = NeuralNet(1024, [512, 256], 2).to(device)
|
| 51 |
+
linear = torch.load("clip_linear.pt", map_location=device, weights_only=False).to(device)
|
| 52 |
linear.eval()
|
| 53 |
|
| 54 |
return {
|