startharik huseinzol05 commited on
Commit
8df37e6
0 Parent(s):

Duplicate from mesolitica/ms-tts-VITS

Browse files

Co-authored-by: husein zolkepli <[email protected]>

Files changed (5) hide show
  1. .gitattributes +33 -0
  2. README.md +13 -0
  3. app.py +48 -0
  4. packages.txt +1 -0
  5. requirements.txt +7 -0
.gitattributes ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ftz filter=lfs diff=lfs merge=lfs -text
6
+ *.gz filter=lfs diff=lfs merge=lfs -text
7
+ *.h5 filter=lfs diff=lfs merge=lfs -text
8
+ *.joblib filter=lfs diff=lfs merge=lfs -text
9
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
10
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.npy filter=lfs diff=lfs merge=lfs -text
14
+ *.npz filter=lfs diff=lfs merge=lfs -text
15
+ *.onnx filter=lfs diff=lfs merge=lfs -text
16
+ *.ot filter=lfs diff=lfs merge=lfs -text
17
+ *.parquet filter=lfs diff=lfs merge=lfs -text
18
+ *.pb filter=lfs diff=lfs merge=lfs -text
19
+ *.pickle filter=lfs diff=lfs merge=lfs -text
20
+ *.pkl filter=lfs diff=lfs merge=lfs -text
21
+ *.pt filter=lfs diff=lfs merge=lfs -text
22
+ *.pth filter=lfs diff=lfs merge=lfs -text
23
+ *.rar filter=lfs diff=lfs merge=lfs -text
24
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
25
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
26
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
27
+ *.tflite filter=lfs diff=lfs merge=lfs -text
28
+ *.tgz filter=lfs diff=lfs merge=lfs -text
29
+ *.wasm filter=lfs diff=lfs merge=lfs -text
30
+ *.xz filter=lfs diff=lfs merge=lfs -text
31
+ *.zip filter=lfs diff=lfs merge=lfs -text
32
+ *.zst filter=lfs diff=lfs merge=lfs -text
33
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: E2E-TTS VITS
3
+ emoji: 🦜
4
+ colorFrom: pink
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 3.8.2
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: mesolitica/ms-tts-VITS
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ os.environ['CUDA_VISIBLE_DEVICES'] = ''
4
+ os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
5
+
6
+ import malaya_speech
7
+ from malaya_speech.utils.astype import float_to_int
8
+ import gradio as gr
9
+ import logging
10
+ import json
11
+
12
+ logging.basicConfig(level=logging.INFO)
13
+
14
+ MODELS = {}
15
+ AVAILABLE_MODELS = malaya_speech.tts.available_vits().index.tolist()
16
+
17
+ def tts(text, model, temperature, length_ratio):
18
+ global MODELS
19
+ if model not in MODELS:
20
+ MODELS[model] = malaya_speech.tts.vits(model=model)
21
+
22
+ r = MODELS[model].predict(
23
+ text,
24
+ temperature = temperature,
25
+ length_ratio = length_ratio,
26
+ )
27
+ data = float_to_int(r['y'])
28
+ return (22050, data)
29
+
30
+ demo = gr.Interface(
31
+ fn=tts,
32
+ inputs=[
33
+ gr.components.Textbox(label='Text'),
34
+ gr.components.Dropdown(label='Available models', choices=AVAILABLE_MODELS, value = 'mesolitica/VITS-osman'),
35
+ gr.Slider(0.0, 1.0, value=0.6666, label='temperature, changing this will manipulate pitch'),
36
+ gr.Slider(0.0, 3.0, value=1.0, label='length ratio, changing this will manipulate duration output'),
37
+ ],
38
+ outputs=['audio'],
39
+ examples=[
40
+ ['Syed Saddiq berkata, mereka seharusnya mengingati bahawa semasa menjadi Perdana Menteri Pakatan Harapan', 'mesolitica/VITS-osman', 0.6666, 1.0],
41
+ ['SHAH ALAM - Pertubuhan Kebajikan Anak Bersatu Selangor bersetuju pihak kerajaan mewujudkan Suruhanjaya Siasatan Diraja untuk menyiasat isu kartel daging.', 'mesolitica/VITS-haqkiem', 0.6666, 1.0],
42
+ ],
43
+ cache_examples=False,
44
+ title='End-to-End TTS using VITS from Mesolitica',
45
+ )
46
+
47
+ demo.launch(server_name='0.0.0.0')
48
+
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ libsndfile1
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ malaya-speech
2
+ malaya
3
+ tensorflow==2.9.2
4
+ torch==1.12.1
5
+ malaya-boilerplate==0.0.23
6
+ matplotlib
7
+ transformers