Feature Extraction
Transformers
Safetensors
audio_embeddings
audio
custom_code
self-supervised-learning
audio-embeddings
best-rq-2
audioset
Instructions to use ltuncay/BEST-RQ-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ltuncay/BEST-RQ-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="ltuncay/BEST-RQ-2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ltuncay/BEST-RQ-2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download audio-embeddings/scripts/inspect_h5.py from ltuncay/BEST-RQ-2: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/ltuncay/BEST-RQ-2/resolve/main/audio-embeddings/scripts/inspect_h5.py
- Command line
-
hf download hf://ltuncay/BEST-RQ-2/audio-embeddings/scripts/inspect_h5.py
-
curl -L -o inspect_h5.py https://huggingface.co/ltuncay/BEST-RQ-2/resolve/main/audio-embeddings/scripts/inspect_h5.py
633 Bytes
| import h5py | |
| import os | |
| def inspect_h5(): | |
| # Path from previous context | |
| h5_path = "/media/ltuncay/Shared-4TB/dev/audio-embeddings/data/AudioSet/balanced_train_soxrhq.h5" | |
| if not os.path.exists(h5_path): | |
| print(f"File not found: {h5_path}") | |
| return | |
| with h5py.File(h5_path, "r") as f: | |
| print("Keys:", list(f.keys())) | |
| if "waveform" in f: | |
| print("Waveform shape:", f["waveform"].shape) | |
| print("Waveform attrs:", dict(f["waveform"].attrs)) | |
| # Check for global attributes | |
| print("Global attrs:", dict(f.attrs)) | |
| if __name__ == "__main__": | |
| inspect_h5() | |