Automatic Speech Recognition
Transformers
Safetensors
English
asr_model
asr
speech-recognition
speech-to-text
audio
speech-llm
word-timestamps
speaker-diarization
qwen
granite-speech
lora
custom_code
Eval Results (legacy)
Instructions to use mazesmazes/tiny-audio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mazesmazes/tiny-audio with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="mazesmazes/tiny-audio", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSpeechSeq2Seq model = AutoModelForSpeechSeq2Seq.from_pretrained("mazesmazes/tiny-audio", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update custom model files, README, and requirements
Browse files- asr_modeling.py +6 -0
asr_modeling.py
CHANGED
|
@@ -619,10 +619,16 @@ class ASRModel(PreTrainedModel, GenerationMixin):
|
|
| 619 |
# PEFT handles Hub downloads and caching internally
|
| 620 |
from peft import PeftModel
|
| 621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 622 |
model.language_model = PeftModel.from_pretrained(
|
| 623 |
model.language_model,
|
| 624 |
pretrained_model_name_or_path,
|
| 625 |
is_trainable=True,
|
|
|
|
| 626 |
**cache_kwargs,
|
| 627 |
)
|
| 628 |
else:
|
|
|
|
| 619 |
# PEFT handles Hub downloads and caching internally
|
| 620 |
from peft import PeftModel
|
| 621 |
|
| 622 |
+
# Adapter weights load onto the base model's device. Left to
|
| 623 |
+
# PEFT they go straight to "cuda" whenever CUDA reports
|
| 624 |
+
# available, which ZeroGPU Spaces do at startup without a
|
| 625 |
+
# GPU attached ("No CUDA GPUs are available").
|
| 626 |
+
base_device = next(model.language_model.parameters()).device
|
| 627 |
model.language_model = PeftModel.from_pretrained(
|
| 628 |
model.language_model,
|
| 629 |
pretrained_model_name_or_path,
|
| 630 |
is_trainable=True,
|
| 631 |
+
torch_device=str(base_device),
|
| 632 |
**cache_kwargs,
|
| 633 |
)
|
| 634 |
else:
|