Instructions to use Aarjan/swar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- F5-TTS
How to use Aarjan/swar with F5-TTS:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download app/tools/mos.py from Aarjan/swar: direct link, hf CLI and curl.
- Browser
- Download file 677 Bytes
-
https://huggingface.co/Aarjan/swar/resolve/main/app/tools/mos.py
- Command line
-
hf download hf://Aarjan/swar/app/tools/mos.py
-
curl -L -o mos.py https://huggingface.co/Aarjan/swar/resolve/main/app/tools/mos.py
677 Bytes
| """Automatic naturalness score (UTMOS22 strong, 1-5) so data or recipe changes that | |
| hurt audio quality (e.g. 16 kHz training audio) show up next to CER and similarity. | |
| Language-agnostic acoustic quality, not a substitute for Nepali listeners.""" | |
| import os | |
| _model = None | |
| DEV = os.environ.get("EVAL_DEVICE", "cuda") | |
| def utmos(wav16k): | |
| """wav16k: 1-D float numpy array at 16 kHz -> predicted MOS.""" | |
| global _model | |
| import torch | |
| if _model is None: | |
| _model = torch.hub.load("tarepan/SpeechMOS:v1.2.0", "utmos22_strong", trust_repo=True).to(DEV).eval() | |
| with torch.no_grad(): | |
| return float(_model(torch.tensor(wav16k).unsqueeze(0).to(DEV), 16000)) | |