sindhuhegde commited on
Commit
edf089c
1 Parent(s): afa2bc0

Update app

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -559,8 +559,7 @@ def load_checkpoint(path, model):
559
  new_s[k.replace('module.', '')] = v
560
  model.load_state_dict(new_s)
561
 
562
- if use_cuda:
563
- model.to(device)
564
 
565
  print("Loaded checkpoint from: {}".format(path))
566
 
@@ -1094,7 +1093,7 @@ def get_embeddings(video_sequences, audio_sequences, model, calc_aud_emb=True):
1094
  video_emb = []
1095
  audio_emb = []
1096
 
1097
- model = model.to(device)
1098
 
1099
  for i in tqdm(range(0, len(video_sequences), batch_size)):
1100
  video_inp = video_sequences[i:i+batch_size, ]
@@ -1110,6 +1109,8 @@ def get_embeddings(video_sequences, audio_sequences, model, calc_aud_emb=True):
1110
 
1111
  # torch.cuda.empty_cache()
1112
 
 
 
1113
  video_emb = torch.cat(video_emb, dim=0)
1114
 
1115
  if calc_aud_emb:
 
559
  new_s[k.replace('module.', '')] = v
560
  model.load_state_dict(new_s)
561
 
562
+ model.to(device)
 
563
 
564
  print("Loaded checkpoint from: {}".format(path))
565
 
 
1093
  video_emb = []
1094
  audio_emb = []
1095
 
1096
+ # model = model.to(device)
1097
 
1098
  for i in tqdm(range(0, len(video_sequences), batch_size)):
1099
  video_inp = video_sequences[i:i+batch_size, ]
 
1109
 
1110
  # torch.cuda.empty_cache()
1111
 
1112
+ print("Extracted embeddings")
1113
+
1114
  video_emb = torch.cat(video_emb, dim=0)
1115
 
1116
  if calc_aud_emb: