Views
No views yet
| Parametr | Qiymat |
|---|---|
| Learning rate | 1e-5 |
| Epochs | 5 (early stopping bilan 4-epochda to'xtatildi) |
| Batch size | 2 (gradient accumulation 8, effektiv batch 16) |
| Optimal checkpoint | Epoch 2 |
| Mixed precision | fp16 |
| Epoch | Training Loss | Validation Loss | WER |
|---|---|---|---|
| 1 | 0.1927 | 0.1058 | 11.18% |
| 2 (tanlangan) | 0.0465 | 0.1121 | 8.82% |
| 3 | 0.0287 | 0.1185 | 10.39% |
| 4 | 0.0178 | 0.1185 | 9.97% |
1from transformers import WhisperProcessor, WhisperForConditionalGeneration
2import librosa
3
4processor = WhisperProcessor.from_pretrained("BaseLayer/uzbek_stt_model")
5model = WhisperForConditionalGeneration.from_pretrained("BaseLayer/uzbek_stt_model")
6
7audio, sr = librosa.load("audio.wav", sr=16000)
8input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features
9
10predicted_ids = model.generate(input_features, language="uz", task="transcribe")
11transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
12print(transcription)pipeline orqali:1from transformers import pipeline
2
3pipe = pipeline(
4 "automatic-speech-recognition",
5 model="BaseLayer/sota_uzbek_stt_lowvolume",
6 chunk_length_s=30,
7 device="cuda"
8)
9
10result = pipe("audio.wav", generate_kwargs={"language": "uz", "task": "transcribe"})
11print(result["text"])