File size: 2,613 Bytes
ca90f09
d02ad9c
fbc3e31
2f7d9da
 
d02ad9c
 
194fffd
c98fc74
25a1b59
74d134e
a83a001
ee41509
a56b486
 
d069b98
a83a001
a56b486
915ef6e
d739858
194fffd
150a207
90959c1
36ebb52
194fffd
 
fab601a
194fffd
36ebb52
e1c65f1
36ebb52
0dfedcd
 
 
e886026
 
194fffd
 
 
142fdc7
 
 
48b3e91
142fdc7
 
 
 
 
 
 
db322d5
142fdc7
 
 
 
 
 
 
e886026
142fdc7
c6f8b29
142fdc7
 
48b3e91
142fdc7
 
 
72b6265
142fdc7
939c1fe
 
ec57f8f
f74bce2
72b6265
f74bce2
0287131
 
 
939c1fe
 
2bb432c
939c1fe
142fdc7
194fffd
 
98d97a5
2cd6c69
194fffd
 
cff1c92
3444a7f
0f6c489
e04518b
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
import sys
import os
from fastapi import Request
# By using XTTS you agree to CPML license https://coqui.ai/cpml
os.environ["COQUI_TOS_AGREED"] = "1"

import gradio as gr
from TTS.api import TTS
from TTS.utils.manage import ModelManager
model_names = TTS().list_models()
print(model_names.__dict__)
print(model_names.__dir__())
model_name = "tts_models/multilingual/multi-dataset/xtts_v2"
#m = ModelManager().download_model(model_name)
#print(m)
m = model_name

tts = TTS(model_name, gpu=False)
tts.to("cpu") # no GPU or Amd
#tts.to("cuda") # cuda only


def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree, request: gr.Request):
    return (None, None) 


title = "XTTS Glz's remake (Fonctional Text-2-Speech)"

description = ""

article = ""
examples = [
]



gr.Interface(
    fn=predict,
    inputs=[
        gr.Textbox(
            label="Text Prompt",
            info="One or two sentences at a time is better",
            value="Hello, World !, here is an example of light voice cloning. Try to upload your best audio samples quality",
        ),
        gr.Dropdown(
            label="Language",
            info="Select an output language for the synthesised speech",
            choices=[
                "en",
                "es",
                "fr",
                "de",
                "it",
                "pt",
                "pl",
                "tr",
                "ru",
                "nl",
                "cs",
                "ar",
                "zh-cn",
            ],
            max_choices=1,
            value="en",
        ),
        gr.Audio(
            label="Reference Audio",
            #info="Click on the ✎ button to upload your own target speaker audio",
            type="filepath",
            value="examples/female.wav",
        ),
        gr.Audio(sources=["microphone"],
                 type="filepath",
                 #info="Use your microphone to record audio",
                 label="Use Microphone for Reference"),
        gr.Checkbox(label="Check to use Microphone as Reference",
                    value=False,
                    info="Notice: Microphone input may not work properly under traffic",),
        gr.Checkbox(
            label="Agree",
            value=True,
            info="I agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml",
        ),
    ],
    outputs=[
        gr.Video(label="Waveform Visual"),
        gr.Audio(label="Synthesised Audio"),
    ],
    title=title,
    description=description,
    article=article,
    examples=examples,
).queue().launch(debug=True)