chendl commited on
Commit
c43500b
·
1 Parent(s): 6241c4a

update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -10
app.py CHANGED
@@ -16,19 +16,28 @@ from PIL import Image
16
  from huggingface_hub import hf_hub_download, login
17
 
18
  from open_flamingo.src.factory import create_model_and_transforms
 
 
19
  flamingo, image_processor, tokenizer, vis_embed_size = create_model_and_transforms(
20
- "ViT-L-14",
21
- "datacomp_xl_s13b_b90k",
22
- "EleutherAI/pythia-1.4b",
23
- "EleutherAI/pythia-1.4b",
24
- add_visual_grounding=True,
25
- location_token_num=1000,
26
- add_visual_token = True,
27
- use_format_v2 = True,
28
- )
 
 
 
 
 
 
 
29
 
30
  checkpoint_path = hf_hub_download("chendl/compositional_test", "pythiaS.pt")
31
- checkpoint = torch.load(checkpoint_path, map_location="cpu")
32
  model_state_dict = {}
33
  for key in checkpoint.keys():
34
  model_state_dict[key.replace("module.", "")] = checkpoint[key]
 
16
  from huggingface_hub import hf_hub_download, login
17
 
18
  from open_flamingo.src.factory import create_model_and_transforms
19
+
20
+
21
  flamingo, image_processor, tokenizer, vis_embed_size = create_model_and_transforms(
22
+ args.vision_encoder_path,
23
+ args.vision_encoder_pretrained,
24
+ args.lm_path,
25
+ args.lm_tokenizer_path,
26
+ location_token_num=1000,
27
+ lora=False,
28
+ lora_r=16,
29
+ use_sam=None,
30
+ add_visual_token=True,
31
+ use_format_v2=True,
32
+ add_box=True,
33
+ add_pe=False,
34
+ add_relation=False,
35
+ enhance_data=False,
36
+ )
37
+
38
 
39
  checkpoint_path = hf_hub_download("chendl/compositional_test", "pythiaS.pt")
40
+ checkpoint = torch.load(checkpoint_path, map_location="cpu")["model_state_dict"]
41
  model_state_dict = {}
42
  for key in checkpoint.keys():
43
  model_state_dict[key.replace("module.", "")] = checkpoint[key]