Feature Extraction
Transformers
Safetensors
English
usad
automatic-speech-recognition
audio-classification
audio
speech
music
custom_code
Instructions to use MIT-SLS/USAD-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MIT-SLS/USAD-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="MIT-SLS/USAD-Base", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MIT-SLS/USAD-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 498 Bytes
b038b10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # modeling_usad.py
from transformers import PreTrainedModel
from .configuration_usad import USADConfig
from .usad_model import UsadModel as model
class USADModel(PreTrainedModel):
config_class = USADConfig
def __init__(self, config: USADConfig):
super().__init__(config)
self.model = model(config)
def forward(self, *args, **kwargs):
return self.model(*args, **kwargs)
def load_audio(self, audio_path):
return self.model.load_audio(audio_path)
|