Instructions to use lgris/distil-whisper-large-v2-pt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lgris/distil-whisper-large-v2-pt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="lgris/distil-whisper-large-v2-pt")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("lgris/distil-whisper-large-v2-pt") model = AutoModelForSpeechSeq2Seq.from_pretrained("lgris/distil-whisper-large-v2-pt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| accelerate launch run_distillation.py \ | |
| --model_name_or_path "./distil-large-v2-init" \ | |
| --teacher_model_name_or_path "openai/whisper-large-v2" \ | |
| --train_dataset_name "../common_voice_13_0_pt_pseudo_labelled+../common_voice_13_0_pt_pseudo_labelled" \ | |
| --train_split_name "train+validation" \ | |
| --text_column_name "sentence+sentence" \ | |
| --train_dataset_samples "10+5" \ | |
| --eval_dataset_name "../common_voice_13_0_pt_pseudo_labelled" \ | |
| --eval_split_name "test" \ | |
| --eval_text_column_name "sentence" \ | |
| --eval_steps 1000 \ | |
| --save_steps 1000 \ | |
| --warmup_steps 50 \ | |
| --learning_rate 0.0001 \ | |
| --lr_scheduler_type "constant_with_warmup" \ | |
| --logging_steps 25 \ | |
| --save_total_limit 1 \ | |
| --max_steps 5000 \ | |
| --wer_threshold 10 \ | |
| --per_device_train_batch_size 16 \ | |
| --per_device_eval_batch_size 16 \ | |
| --dataloader_num_workers 4 \ | |
| --preprocessing_num_workers 4 \ | |
| --ddp_timeout 7200 \ | |
| --dtype "bfloat16" \ | |
| --output_dir "." \ | |
| --do_train \ | |
| --do_eval \ | |
| --gradient_checkpointing \ | |
| --overwrite_output_dir \ | |
| --predict_with_generate \ | |
| --freeze_encoder \ | |
| --streaming False \ | |
| --train_dataset_config_name "pt+pt" \ | |
| --eval_dataset_config_name "pt" \ | |
| --report_to "tensorboard" \ | |
| --push_to_hub | |