Instructions to use DBD-research-group/Bird-MAE-Large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DBD-research-group/Bird-MAE-Large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="DBD-research-group/Bird-MAE-Large", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("DBD-research-group/Bird-MAE-Large", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update feature_extractor.py
Browse files- feature_extractor.py +1 -1
feature_extractor.py
CHANGED
|
@@ -66,7 +66,7 @@ class BirdMAEFeatureExtractor(SequenceFeatureExtractor):
|
|
| 66 |
):
|
| 67 |
|
| 68 |
if not torch.is_tensor(waveform_batch):
|
| 69 |
-
waveform_batch = torch.
|
| 70 |
|
| 71 |
if len(waveform_batch.shape) == 1:
|
| 72 |
waveform_batch = waveform_batch.unsqueeze(0)
|
|
|
|
| 66 |
):
|
| 67 |
|
| 68 |
if not torch.is_tensor(waveform_batch):
|
| 69 |
+
waveform_batch = torch.from_numpy(np.array(waveform_batch))
|
| 70 |
|
| 71 |
if len(waveform_batch.shape) == 1:
|
| 72 |
waveform_batch = waveform_batch.unsqueeze(0)
|