Downloads · 30 days
0
ShakhzoDavronov/whisper-large-lora-uz
whisper-large-lora-uz is a machine learning model from ShakhzoDavronov. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
The Whisper model was fine tuned with LORA (Low-Rank Adaption) to reduce time consumption and efficent use of resource (GPU/CPU). - Base model: whisper-large-v2 (over 1.5B million parameters) - LORA fine-tuned model:…
Downloads · 30 days
0
Access
Public
Updated Mar 5, 2025
Repo size
63 MB
Likes
0
Public
Click a slice to open those files.
.safetensors63 MB · 100%
From the Hugging Face model README
The Whisper model was fine tuned with LORA (Low-Rank Adaption) to reduce time consumption and efficent use of resource (GPU/CPU).
The popular dataset common voice version 13.0 was feed into model.
With code provided below user can test model performance:
import torch
from transformers import AutomaticSpeechRecognitionPipeline
from transformers import WhisperTokenizer,WhisperForConditionalGeneration,WhisperProcessor
from peft import PeftModel, PeftConfig
stt_model_id = "ShakhzoDavronov/whisper-large-lora-uz"
language = "Uzbek"
task = "transcribe"
stt_config = PeftConfig.from_pretrained(stt_model_id)
stt_model = WhisperForConditionalGeneration.from_pretrained(
stt_config.base_model_name_or_path, load_in_8bit=True, device_map="auto"
)
stt_model = PeftModel.from_pretrained(stt_model, stt_model_id)
stt_tokenizer = WhisperTokenizer.from_pretrained(stt_config.base_model_name_or_path, language=language, task=task)
stt_processor = WhisperProcessor.from_pretrained(stt_config.base_model_name_or_path, language=language, task=task)
stt_feature_extractor = stt_processor.feature_extractor
forced_decoder_ids = stt_processor.get_decoder_prompt_ids(language=language, task=task)
stt_pipe = AutomaticSpeechRecognitionPipeline(model=stt_model, tokenizer=stt_tokenizer, feature_extractor=stt_feature_extractor)
def transcribe(audio):
with torch.cuda.amp.autocast():
text = stt_pipe(audio, generate_kwargs={"forced_decoder_ids": forced_decoder_ids}, max_new_tokens=255)["text"]
return text
extracted_text=transcribe(test_audio)
ner_labels=ner_pipe(extracted_text)
for ner in ner_labels:
print(ner)
Results:
Soon