mshukor HF Staff commited on
Commit
c9e7d7d
·
1 Parent(s): f2adb5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -54,7 +54,7 @@ config = 'configs/audio/ePALM_audio_caption.yaml'
54
  config = yaml.load(open(config, 'r'))
55
 
56
  text_model = 'facebook/opt-2.7b'
57
- vision_model_name = 'vit_base_patch16_224'
58
 
59
 
60
  start_layer_idx = 19
@@ -72,7 +72,7 @@ MODEL = ePALM(opt_model_name=text_model,
72
  print("Model Built")
73
  MODEL.to(device)
74
 
75
- checkpoint_path = 'checkpoints/float32/ePALM_caption/checkpoint_best.pth'
76
  checkpoint = torch.load(checkpoint_path, map_location='cpu')
77
  state_dict = checkpoint['model']
78
  msg = MODEL.load_state_dict(state_dict,strict=False)
@@ -82,13 +82,6 @@ MODEL.bfloat16()
82
 
83
 
84
 
85
- # Audio Captioning
86
- checkpoint_path = 'checkpoints/float32/ePALM_audio_caption/checkpoint_best.pth'
87
- checkpoint = torch.load(checkpoint_path, map_location='cpu')
88
- state_dict_audio_caption = checkpoint['model']
89
-
90
-
91
-
92
 
93
  ## Load tokenizer
94
  tokenizer = AutoTokenizer.from_pretrained(text_model, use_fast=False)
 
54
  config = yaml.load(open(config, 'r'))
55
 
56
  text_model = 'facebook/opt-2.7b'
57
+ vision_model_name = 'ast'
58
 
59
 
60
  start_layer_idx = 19
 
72
  print("Model Built")
73
  MODEL.to(device)
74
 
75
+ checkpoint_path = 'checkpoints/float32/ePALM_audio_caption/checkpoint_best.pth'
76
  checkpoint = torch.load(checkpoint_path, map_location='cpu')
77
  state_dict = checkpoint['model']
78
  msg = MODEL.load_state_dict(state_dict,strict=False)
 
82
 
83
 
84
 
 
 
 
 
 
 
 
85
 
86
  ## Load tokenizer
87
  tokenizer = AutoTokenizer.from_pretrained(text_model, use_fast=False)