VIZINTZOR commited on
Commit
8feed2d
·
verified ·
1 Parent(s): a4d9421

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -0
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - th
4
+ tags:
5
+ - text-to-speech
6
+ - Thai
7
+ ---
8
+
9
+ Finetune โมเดลโค้ด GitHub : https://github.com/VYNCX/finetune-local-vits
10
+
11
+ [Finetune-colab](https://colab.research.google.com/drive/12qbpHnu7wYiTEoqh6_57_KUjp4gJkx2h?usp=sharing
12
+ ) เทรนโมเดลเสียงด้วยตัวเองบน Google Colab
13
+
14
+ ใช้งาน บน local คอมพิวเตอร์ https://github.com/VYNCX/VachanaTTS
15
+
16
+ การใช้งาน :
17
+ ```py
18
+ import torch
19
+ from transformers import VitsTokenizer, VitsModel, set_seed
20
+ import scipy
21
+
22
+ tokenizer = VitsTokenizer.from_pretrained("VIZINTZOR/MMS-TTS-THAI-MALE-PODCAST",cache_dir="./mms")
23
+ model = VitsModel.from_pretrained("VIZINTZOR/MMS-TTS-THAI-MALE-PODCAST",cache_dir="./mms")
24
+
25
+ inputs = tokenizer(text="สวัสดีครับ นี่คือเสียงพูดภาษาไทย", return_tensors="pt")
26
+
27
+ set_seed(456) # make deterministic
28
+
29
+ with torch.no_grad():
30
+ outputs = model(**inputs)
31
+
32
+ waveform = outputs.waveform[0]
33
+
34
+ # Convert PyTorch tensor to NumPy array
35
+ waveform_array = waveform.numpy()
36
+
37
+ scipy.io.wavfile.write("techno_output.wav", rate=model.config.sampling_rate, data=waveform_array)
38
+ ```