Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from huggingface_hub import hf_hub_download
|
|
10 |
|
11 |
tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased', )
|
12 |
|
13 |
-
ckpt = torch.load(hf_hub_download('tennant/MUG', '
|
14 |
|
15 |
new_dict = OrderedDict()
|
16 |
for k, v in ckpt.items():
|
@@ -19,7 +19,8 @@ for k, v in ckpt.items():
|
|
19 |
|
20 |
model = mae_vit_base_patch16(uni_dim=768, less_u=True)
|
21 |
|
22 |
-
model.load_state_dict(new_dict)
|
|
|
23 |
if torch.cuda.is_available():
|
24 |
model.cuda()
|
25 |
model.eval()
|
|
|
10 |
|
11 |
tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased', )
|
12 |
|
13 |
+
ckpt = torch.load(hf_hub_download('tennant/MUG', 'laion_mug_vit_base_5ep.pth'), map_location='cpu')
|
14 |
|
15 |
new_dict = OrderedDict()
|
16 |
for k, v in ckpt.items():
|
|
|
19 |
|
20 |
model = mae_vit_base_patch16(uni_dim=768, less_u=True)
|
21 |
|
22 |
+
msg = model.load_state_dict(new_dict, strict=False)
|
23 |
+
print(msg)
|
24 |
if torch.cuda.is_available():
|
25 |
model.cuda()
|
26 |
model.eval()
|