Pipe1213 commited on
Commit
468533f
1 Parent(s): 4e3079b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -6
app.py CHANGED
@@ -14,9 +14,38 @@ import utils
14
  from data_utils import TextAudioLoader, TextAudioCollate, TextAudioSpeakerLoader, TextAudioSpeakerCollate
15
  from models import SynthesizerTrn
16
  from text.symbols import symbols
17
- from text import text_to_sequence
18
  from scipy.io.wavfile import write
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  def get_text(text, hps):
21
  text_norm = text_to_sequence(text, hps.data.text_cleaners)
22
  if hps.data.add_blank:
@@ -77,20 +106,33 @@ with app:
77
  Based on VITS (https://github.com/jaywalnut310/vits).
78
 
79
  Write the text in phonemes or graphemes depending on the model.
 
 
 
 
 
 
 
 
 
80
 
81
- For faster inference speed it is recommended to use short sentences.
 
 
82
  """
83
  )
84
  with gr.Tabs():
85
  create_tab("Phonemes_finetuned")
 
86
 
87
  gr.Markdown(
88
  """
89
  ### Examples
90
- | Input Text | Speaker | Input Method |
91
- |------------|---------|---------------|
92
- | li biːç ɛ l sɔlja ɛstẽ ki s maʁɡajẽ pɔ sawɛ kiː ski , dɛ døː , ɛstøː l py fwaʁ . m ɛ̃ s koː la , la k i vɛjɛ õ tsminɔː k aʁivef pjim pjam , d ɛ̃ õ bja nuː tsoː paltɔ . | Female | Phonemes |
93
- | Li bijhe et l’ solea estént ki s’ margayént po sawè kî çki, des deus, esteut l’ pus foirt. Mins ç’ côp la, la k’ i veyèt on tchminåd k' arivéve pyim piam, dins on bea noû tchôd paltot. | Male | Graphemes |
 
94
  """
95
  )
96
 
 
14
  from data_utils import TextAudioLoader, TextAudioCollate, TextAudioSpeakerLoader, TextAudioSpeakerCollate
15
  from models import SynthesizerTrn
16
  from text.symbols import symbols
17
+ #from text import text_to_sequence
18
  from scipy.io.wavfile import write
19
 
20
+ # symbols = symbols_gra # change this later
21
+ _symbol_to_id = {s: i for i, s in enumerate(symbols)}
22
+ _id_to_symbol = {i: s for i, s in enumerate(symbols)}
23
+
24
+ def text_to_sequence(text, cleaner_names):
25
+ '''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
26
+ Args:
27
+ text: string to convert to a sequence
28
+ cleaner_names: names of the cleaner functions to run the text through
29
+ Returns:
30
+ List of integers corresponding to the symbols in the text
31
+ '''
32
+ sequence = []
33
+
34
+ clean_text = _clean_text(text, cleaner_names)
35
+ for symbol in clean_text:
36
+ symbol_id = _symbol_to_id[symbol]
37
+ sequence += [symbol_id]
38
+ return sequence
39
+
40
+ def _clean_text(text, cleaner_names):
41
+ for name in cleaner_names:
42
+ cleaner = getattr(cleaners, name)
43
+ if not cleaner:
44
+ raise Exception('Unknown cleaner: %s' % name)
45
+ text = cleaner(text)
46
+ return text
47
+
48
+
49
  def get_text(text, hps):
50
  text_norm = text_to_sequence(text, hps.data.text_cleaners)
51
  if hps.data.add_blank:
 
106
  Based on VITS (https://github.com/jaywalnut310/vits).
107
 
108
  Write the text in phonemes or graphemes depending on the model.
109
+ For faster inference, it is recommended to use short sentences.
110
+
111
+ The quality of the results varies between male and female voice due to the limited data for female voice on this language.
112
+ For better results with male voice, use the models fully trained on Walloon.
113
+ For better results with female voice, use the models trained on french and fine-tuned on Walloon.
114
+
115
+ To try the version trained in graphemes follow the link below:
116
+
117
+ https://huggingface.co/spaces/Pipe1213/VITS_Walloon_Graphemes
118
 
119
+
120
+ ## Hint: Some sample texts are available at the bottom of the web site.
121
+ ## Hint: For faster inference speed it is recommended to use short sentences.
122
  """
123
  )
124
  with gr.Tabs():
125
  create_tab("Phonemes_finetuned")
126
+ create_tab("Phonemes(not working yet!!!)")
127
 
128
  gr.Markdown(
129
  """
130
  ### Examples
131
+ | Input Text | Speaker |
132
+ |------------|---------|
133
+ | li biːç ɛ l sɔlja ɛstẽ ki s maʁɡajẽ pɔ sawɛ kiː ski , dɛ døː , ɛstøː l py fwaʁ . m ɛ̃ s koː la , la k i vɛjɛ õ tsminɔː k aʁivef pjim pjam , d ɛ̃ õ bja nuː tsoː paltɔ . | Female |
134
+ | ɛl m õ ʁɛspõdu , duvẽ ɔːʁẽ n pøː d õ tsapja . | Male |
135
+ | dɔ koː , dz a dvu tswɛzi ɛn oːt mɛstiː , dz ast apʁ ɛ̃ a mõne dɛz avjõ .| Female |
136
  """
137
  )
138