berkaygkv54 commited on
Commit
a350907
1 Parent(s): b325cd1

skipping vectors fixed

Browse files
Files changed (1) hide show
  1. src/laion_clap/inference.py +3 -1
src/laion_clap/inference.py CHANGED
@@ -62,7 +62,8 @@ class AudioEncoder(laion_clap.CLAP_Module):
62
  # tracking_result = list(self.collection.find({}, {"embedding": 0}))
63
  arrays = []
64
  track_data = []
65
- for idx, track in enumerate(self.collection.find({})):
 
66
  if not track.get("embedding"):
67
  continue
68
  data = track.copy()
@@ -70,6 +71,7 @@ class AudioEncoder(laion_clap.CLAP_Module):
70
  data.update({"vector_idx": idx})
71
  arrays.append(track["embedding"][0])
72
  track_data.append(data)
 
73
 
74
  self.music_data = torch.tensor(arrays)
75
  self.track_data = track_data.copy()
 
62
  # tracking_result = list(self.collection.find({}, {"embedding": 0}))
63
  arrays = []
64
  track_data = []
65
+ idx = 0
66
+ for track in self.collection.find({}):
67
  if not track.get("embedding"):
68
  continue
69
  data = track.copy()
 
71
  data.update({"vector_idx": idx})
72
  arrays.append(track["embedding"][0])
73
  track_data.append(data)
74
+ idx += 1
75
 
76
  self.music_data = torch.tensor(arrays)
77
  self.track_data = track_data.copy()