freddyaboulton HF Staff commited on
Commit
c3277a4
·
1 Parent(s): b3948c4
Files changed (2) hide show
  1. app.py +1 -1
  2. audio_index.py +1 -1
app.py CHANGED
@@ -21,7 +21,7 @@ audio_embedding_system = AudioEmbeddingSystem(db_path=db_file, index_path=index_
21
  def audio_search(audio_tuple):
22
  sample_rate, array = audio_tuple
23
  array = array[: int(sample_rate * 10)]
24
- rows = audio_embedding_system.search(sample_rate, array)
25
  orig_rows = search(rows)
26
  for row in rows:
27
  path = row["path"]
 
21
  def audio_search(audio_tuple):
22
  sample_rate, array = audio_tuple
23
  array = array[: int(sample_rate * 10)]
24
+ rows = audio_embedding_system.search((sample_rate, array))
25
  orig_rows = search(rows)
26
  for row in rows:
27
  path = row["path"]
audio_index.py CHANGED
@@ -124,7 +124,7 @@ class AudioEmbeddingSystem:
124
  if isinstance(row, dict):
125
  query_embedding = self.extract_embedding(row)
126
  else:
127
- query_embedding = get_embedding_from_array(row)
128
 
129
  query_embedding = query_embedding.reshape(1, -1).astype(np.float32)
130
 
 
124
  if isinstance(row, dict):
125
  query_embedding = self.extract_embedding(row)
126
  else:
127
+ query_embedding = get_embedding_from_array(*row)
128
 
129
  query_embedding = query_embedding.reshape(1, -1).astype(np.float32)
130