joefox commited on
Commit
b32e3ab
·
1 Parent(s): f21da68

feat add readme

Browse files
Files changed (1) hide show
  1. README.md +50 -0
README.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ru
4
+ tags:
5
+ - vits
6
+ license: cc-by-nc-4.0
7
+ pipeline_tag: text-to-speech
8
+ widget:
9
+ - example_title: text to speech
10
+ text: >
11
+ Привет, как дел+а? Всё +очень хорош+о! А у тебя как?
12
+ ---
13
+
14
+ # VITS model Text to Speech Russian
15
+
16
+ Example Text to Speech
17
+
18
+ ```python
19
+ from transformers import VitsModel, AutoTokenizer
20
+ import torch
21
+ import scipy
22
+
23
+ model = VitsModel.from_pretrained("joefox/tts_vits_ru_hf")
24
+ tokenizer = AutoTokenizer.from_pretrained("joefox/tts_vits_ru_hf")
25
+
26
+ text = "Привет, как дел+а? Всё +очень хорош+о! А у тебя как?"
27
+ inputs = tokenizer(text, return_tensors="pt")
28
+ inputs['speaker_id'] = 3
29
+
30
+ with torch.no_grad():
31
+ output = model(**inputs).waveform
32
+
33
+ scipy.io.wavfile.write("techno.wav", rate=model.config.sampling_rate, data=output[0].cpu().numpy())
34
+ ```
35
+
36
+
37
+
38
+ For displayed in a Jupyter Notebook / Google Colab:
39
+
40
+ ```python
41
+ from IPython.display import Audio
42
+
43
+ Audio(output, rate=model.config.sampling_rate)
44
+ ```
45
+
46
+ ##
47
+
48
+ ## Languages covered
49
+
50
+ Russian (ru_RU)