Automatic Speech Recognition
Transformers
PyTorch
Safetensors
Vietnamese
whisper
Generated from Trainer
Instructions to use bavihao/Ahao-Whisper-medium-Vi-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bavihao/Ahao-Whisper-medium-Vi-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="bavihao/Ahao-Whisper-medium-Vi-v2")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("bavihao/Ahao-Whisper-medium-Vi-v2") model = AutoModelForSpeechSeq2Seq.from_pretrained("bavihao/Ahao-Whisper-medium-Vi-v2") - Notebooks
- Google Colab
- Kaggle
#us
import torch
import accelerate
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model_id = "bavihao/Ahao-Whisper-medium-Vi-v2"
model = AutoModelForSpeechSeq2Seq.from_pretrained(
model_id, torch_dtype=torch_dtype, device_map = 'auto'
)
processor = AutoProcessor.from_pretrained(model_id)
pipe = pipeline(
"automatic-speech-recognition",
model=model,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
batch_size=16,
return_timestamps=True,
torch_dtype=torch_dtype,
)
result = pipe(audio_path, generate_kwargs={"language": "vietnamese"})
print(result["text"])
- Downloads last month
- 5
Model tree for bavihao/Ahao-Whisper-medium-Vi-v2
Base model
openai/whisper-medium