Instructions to use SharadhNaiduTrains/sravaani-flow-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SharadhNaiduTrains/sravaani-flow-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="SharadhNaiduTrains/sravaani-flow-model", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SharadhNaiduTrains/sravaani-flow-model", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| import sys, torch | |
| from transformers import AutoModel | |
| REPO = "." | |
| DEV = "cuda" if torch.cuda.is_available() else "cpu" | |
| model = AutoModel.from_pretrained(REPO, trust_remote_code=True).to(DEV).eval() | |
| # NeMo-style convenience API (needs sentencepiece; soundfile or stdlib wave for files): | |
| hyps = model.transcribe(sys.argv[1:], return_hypotheses=True) | |
| for path, h in zip(sys.argv[1:], hyps): | |
| print(f"{path}\t{h.text}") | |
| # --- lower-level alternative (explicit processor) --- | |
| # from transformers import AutoProcessor | |
| # import soundfile as sf # or: import wave (stdlib) for PCM WAV | |
| # proc = AutoProcessor.from_pretrained(REPO, trust_remote_code=True) | |
| # wav, sr = sf.read(path, dtype="float32") # average channels if stereo | |
| # inputs = proc(wav, sampling_rate=sr, return_tensors="pt").to(DEV) | |
| # text = proc.batch_decode(model.generate(**inputs))[0] | |