aliabid94 HF staff commited on
Commit
ef7f77a
1 Parent(s): 024b1c6

Create new file

Browse files
Files changed (1) hide show
  1. app.py +71 -0
app.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ class StressOption(Enum):
4
+ AutomaticStress = "Автоматичні наголоси (за словником) 📖"
5
+ AutomaticStressWithModel = "Автоматичні наголоси (за допомогою моделі) 🧮"
6
+
7
+
8
+ class VoiceOption(Enum):
9
+ FemaleVoice = "Олена (жіночий) 👩"
10
+ MaleVoice = "Микита (чоловічий) 👨"
11
+
12
+
13
+ iface = gr.Interface(
14
+ fn=lambda *args: [None, None],
15
+ inputs=[
16
+ gr.inputs.Textbox(
17
+ label="Input",
18
+ default="Введіть, будь ласка, своє р+ечення.",
19
+ ),
20
+ gr.inputs.Radio(
21
+ label="Голос",
22
+ choices=[option.value for option in VoiceOption],
23
+ default=VoiceOption.FemaleVoice.value,
24
+ ),
25
+ gr.inputs.Radio(
26
+ label="Наголоси",
27
+ choices=[option.value for option in StressOption],
28
+ ),
29
+ ],
30
+ outputs=[
31
+ gr.outputs.Audio(label="Output"),
32
+ gr.outputs.Textbox(label="Наголошений текст"),
33
+ ],
34
+ title="🐸💬🇺🇦 - Coqui TTS",
35
+ description="Україномовний🇺🇦 TTS за допомогою Coqui TTS (щоб вручну поставити наголос, використовуйте + перед голосною)",
36
+ article="Якщо вам подобається, підтримайте за посиланням: [SUPPORT LINK](https://send.monobank.ua/jar/48iHq4xAXm), "
37
+ + "Github: [https://github.com/robinhad/ukrainian-tts](https://github.com/robinhad/ukrainian-tts) \n"
38
+ + "Model training - [Yurii Paniv @robinhad](https://github.com/robinhad) \n"
39
+ + "Mykyta and Olena dataset - [Yehor Smoliakov @egorsmkv](https://github.com/egorsmkv) \n"
40
+ + "Autostress (with dictionary) using [ukrainian-word-stress](https://github.com/lang-uk/ukrainian-word-stress) - [Oleksiy Syvokon @asivokon](https://github.com/asivokon) \n"
41
+ + "Autostress (with model) using [ukrainian-accentor](https://github.com/egorsmkv/ukrainian-accentor) - [Bohdan Mykhailenko @NeonBohdan](https://github.com/NeonBohdan) + [Yehor Smoliakov @egorsmkv](https://github.com/egorsmkv) \n"
42
+ + f'<center><img src="{badge}" alt="visitors badge"/></center>',
43
+ examples=[
44
+ [
45
+ "Введіть, будь ласка, своє речення.",
46
+ VoiceOption.FemaleVoice.value,
47
+ StressOption.AutomaticStress.value,
48
+ ],
49
+ [
50
+ "Введіть, будь ласка, своє речення.",
51
+ VoiceOption.MaleVoice.value,
52
+ StressOption.AutomaticStress.value,
53
+ ],
54
+ [
55
+ "Вв+едіть, будь ласка, св+оє реч+ення.",
56
+ VoiceOption.MaleVoice.value,
57
+ StressOption.AutomaticStress.value,
58
+ ],
59
+ [
60
+ "Привіт, як тебе звати?",
61
+ VoiceOption.FemaleVoice.value,
62
+ StressOption.AutomaticStress.value,
63
+ ],
64
+ [
65
+ "Договір підписано 4 квітня 1949 року.",
66
+ VoiceOption.FemaleVoice.value,
67
+ StressOption.AutomaticStress.value,
68
+ ],
69
+ ],
70
+ )
71
+ iface.launch()