Spaces:
Runtime error
Runtime error
Li
commited on
Commit
•
a230c75
1
Parent(s):
69242c7
update app.py
Browse files
app.py
CHANGED
@@ -27,10 +27,10 @@ flamingo, image_processor, tokenizer, vis_embed_size = create_model_and_transfor
|
|
27 |
)
|
28 |
|
29 |
checkpoint_path = hf_hub_download("chendl/mm", "checkpoint_opt350m.pt")
|
30 |
-
checkpoint = torch.load(
|
31 |
model_state_dict = {}
|
32 |
-
for key in checkpoint
|
33 |
-
model_state_dict[key.replace("module.", "")] = checkpoint[
|
34 |
if "vision_encoder.logit_scale"in model_state_dict:
|
35 |
# previous checkpoint has some unnecessary weights
|
36 |
del model_state_dict["vision_encoder.logit_scale"]
|
|
|
27 |
)
|
28 |
|
29 |
checkpoint_path = hf_hub_download("chendl/mm", "checkpoint_opt350m.pt")
|
30 |
+
checkpoint = torch.load(checkpoint_path, map_location="cpu")
|
31 |
model_state_dict = {}
|
32 |
+
for key in checkpoint.keys():
|
33 |
+
model_state_dict[key.replace("module.", "")] = checkpoint[key]
|
34 |
if "vision_encoder.logit_scale"in model_state_dict:
|
35 |
# previous checkpoint has some unnecessary weights
|
36 |
del model_state_dict["vision_encoder.logit_scale"]
|