File size: 3,301 Bytes
b958ae6
 
 
 
f9b8b84
b958ae6
 
 
 
 
 
 
 
32438e9
 
b958ae6
 
 
 
 
 
 
39cc8c0
b958ae6
39cc8c0
b958ae6
39cc8c0
 
 
 
b958ae6
39cc8c0
b958ae6
39cc8c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b958ae6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: mit
tags:
- generated_from_trainer
base_model: microsoft/speecht5_tts
model-index:
- name: speecht5_finetuned_voxpopuli_nl
  results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# UzbTTS


This model is a fine-tuned version of [microsoft/speecht5_tts](https://huggingface.co/microsoft/speecht5_tts) on the None dataset.
It achieves the following results on the evaluation set:
- Loss: 0.5190

## Model description

UZBTTS - bu asason 250 MB Text2Audio datasetga (microsoft/speecht5_tts) modeliga fine-tuned qilindi, natija datasetga yarasha yaxshi.

Agar siz buni modelni foydalanishini xoxlasangiz.

example:
```
   #dastlab run qiling :
    !pip install transformers datasets

    from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech

    processor = SpeechT5Processor.from_pretrained("ai-nightcoder/UZBTTS")
    model = SpeechT5ForTextToSpeech.from_pretrained("ai-nightcoder/UZBTTS")

    # ***************************************************************************
    text = "O‘zbekistonda import qilingan sovitkich,
           muzlatkich va konditsionerlarni energosamaradorlik bo‘yicha sinovdan o‘tkazish boshlandi.
           Kun.uz'ga murojaat qilgan importchi tadbirkorlarga ko‘ra, bu yangilik ham vaqt,
           ham naqd nuqtayi nazaridan yangi xarajatlarga olib kelgan.
           Kelgusida bunday tekshiruv boshqa turdagi maishiy texnikalarga ham joriy etilishi kutilyapti."

    inputs = processor(text=text, return_tensors="pt")

    # ***************************************************************************

    from datasets import load_dataset

    embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")

    import torch
    # voice clone uchun ham ishlatilsa bo'ladi.
    speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)

    spectrogram = model.generate_speech(inputs["input_ids"], speaker_embeddings)

    from transformers import SpeechT5HifiGan

    vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")

    # ****************************************************************************

    speech = model.generate_speech(inputs["input_ids"], speaker_embeddings, vocoder=vocoder)

    from IPython.display import Audio

    Audio(speech, rate=16000)


### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 4
- eval_batch_size: 2
- seed: 42
- gradient_accumulation_steps: 8
- total_train_batch_size: 32
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 500
- training_steps: 4000
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch  | Step | Validation Loss |
|:-------------:|:------:|:----:|:---------------:|
| 0.479         | 137.93 | 1000 | 0.5174          |
| 0.4318        | 275.86 | 2000 | 0.5177          |
| 0.4111        | 413.79 | 3000 | 0.5302          |
| 0.4081        | 551.72 | 4000 | 0.5190          |


### Framework versions

- Transformers 4.38.1
- Pytorch 2.1.2
- Datasets 2.1.0
- Tokenizers 0.15.1