Spaces:
Sleeping
Sleeping
qwe
Browse files
main.py
CHANGED
|
@@ -109,7 +109,11 @@ def extract_audio_features(file_path: str) -> np.ndarray:
|
|
| 109 |
embeddings = []
|
| 110 |
for chunk in chunks:
|
| 111 |
try:
|
| 112 |
-
inputs = clap_processor(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
with torch.no_grad():
|
| 114 |
emb = clap_model(**inputs).audio_embeds.squeeze().numpy()
|
| 115 |
embeddings.append(emb)
|
|
|
|
| 109 |
embeddings = []
|
| 110 |
for chunk in chunks:
|
| 111 |
try:
|
| 112 |
+
inputs = clap_processor(
|
| 113 |
+
audios=chunk,
|
| 114 |
+
sampling_rate=48000,
|
| 115 |
+
return_tensors="pt"
|
| 116 |
+
)
|
| 117 |
with torch.no_grad():
|
| 118 |
emb = clap_model(**inputs).audio_embeds.squeeze().numpy()
|
| 119 |
embeddings.append(emb)
|