Feature Extraction
Transformers
Safetensors
finelap
audio grounding
audio-text retrieval
sound-event-detection
multimodal
clap
custom_code
Instructions to use AndreasXi/FineLAP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AndreasXi/FineLAP with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="AndreasXi/FineLAP", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AndreasXi/FineLAP", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
update batch infer
Browse files- modeling_finelap.py +2 -2
modeling_finelap.py
CHANGED
|
@@ -122,8 +122,8 @@ class FineLAPModel(PreTrainedModel):
|
|
| 122 |
self.to(device)
|
| 123 |
self.eval()
|
| 124 |
|
| 125 |
-
dense_audio = self.get_dense_audio_embeds(audio_path)
|
| 126 |
-
text_embeds = self.get_global_text_embeds(text_labels, device).unsqueeze(
|
| 127 |
|
| 128 |
sim = torch.matmul(text_embeds, dense_audio.transpose(-1, -2))
|
| 129 |
if hasattr(self, "temp_local"):
|
|
|
|
| 122 |
self.to(device)
|
| 123 |
self.eval()
|
| 124 |
|
| 125 |
+
dense_audio = self.get_dense_audio_embeds(audio_path) # (B, T, D)
|
| 126 |
+
text_embeds = self.get_global_text_embeds(text_labels, device).unsqueeze(0) # (1, N, D)
|
| 127 |
|
| 128 |
sim = torch.matmul(text_embeds, dense_audio.transpose(-1, -2))
|
| 129 |
if hasattr(self, "temp_local"):
|