File size: 910 Bytes
4ea5474
ea6a933
c79df46
 
 
 
4ea5474
 
ea6a933
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ea5474
 
 
 
 
 
 
 
 
 
 
7c2045a
4ea5474
 
 
 
 
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
import gradio as gr
import requests
from subprocess import Popen, PIPE

xvaserver = Popen(['py', 'server.py'], stdout=PIPE, stderr=PIPE)
stdout, stderr = process.communicate()

def predict(input):
	model_type = 'xVAPitch'
	line = 'Test'
	pace = 1.0
	save_path = 'test.wav'
	language = 'en'
	base_speaker_emb = []
	use_sr = 0
	use_cleanup = 0

	data = {
	    'modelType': model_type,
	    'sequence': line,
	    'pace': pace,
	    'outfile': save_path,
	    'vocoder': 'n/a',
	    'base_lang': language,
	    'base_emb': base_speaker_emb,
	    'useSR': use_sr,
	    'useCleanup': use_cleanup,
	}
	requests.post('http://localhost:8008/synthesize', json=data)
	return ''

input_textbox = gr.Textbox(
    label="Input Text",
    lines=1,
    autofocus=True
)

gradio_app = gr.Interface(
    predict,
    input_textbox,
    outputs="text",
    title="xVASynth",
)

if __name__ == "__main__":
    gradio_app.launch()