Audio Classification
speechbrain
PyTorch
English
embeddings
Accent Identification
wav2vec2
XLSR
CommonAccent
English
Instructions to use bookbot/english-accent-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- speechbrain
How to use bookbot/english-accent-classifier with speechbrain:
# interface not specified in config.json
- Notebooks
- Google Colab
- Kaggle
Download custom_interface_local.py from bookbot/english-accent-classifier: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/bookbot/english-accent-classifier/resolve/main/custom_interface_local.py
- Command line
-
hf download hf://bookbot/english-accent-classifier/custom_interface_local.py
-
curl -L -o custom_interface_local.py https://huggingface.co/bookbot/english-accent-classifier/resolve/main/custom_interface_local.py
555 Bytes
| from speechbrain.pretrained import EncoderClassifier | |
| from transformers import AutoProcessor, Wav2Vec2Processor | |
| class CustomEncoderWav2vec2Classifier(EncoderClassifier): | |
| """ | |
| This class inherits from `EncoderClassifier` to handle custom models. | |
| The only difference is that it uses `AutoProcessor` to load the tokenizer. | |
| """ | |
| def __init__(self, *args, **kwargs): | |
| super().__init__(*args, **kwargs) | |
| self.tokenizer = AutoProcessor.from_pretrained( | |
| self.hparams.source, trust_remote_code=True | |
| ) | |