ahnafsamin commited on
Commit
970053f
1 Parent(s): 9be2afa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -21,6 +21,11 @@ gos_text2speech = Text2Speech.from_pretrained(
21
  vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
22
  )
23
 
 
 
 
 
 
24
  westerkwartiers_text2speech = Text2Speech.from_pretrained(
25
  model_tag="https://huggingface.co/ahnafsamin/FastSpeech2-gronings-westerkwartiers/resolve/main/tts_train_fastspeech2_raw_char_tacotron_train.loss.ave.zip",
26
  vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
@@ -36,6 +41,9 @@ def inference(text,lang):
36
  if lang == "gronings":
37
  wav = gos_text2speech(text)["wav"]
38
  scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
 
 
 
39
  elif lang == "gronings westerkwartiers":
40
  wav = westerkwartiers_text2speech(text)["wav"]
41
  wav = wav * 15
@@ -59,7 +67,7 @@ examples = [
59
 
60
  gr.Interface(
61
  inference,
62
- [gr.inputs.Textbox(label="input text", lines=3), gr.inputs.Radio(choices=["gronings", "gronings westerkwartiers", "gronings oldambster"], type="value", default="gronings", label="language")],
63
  [gr.outputs.Audio(type="file", label="Output"), gr.outputs.File()],
64
  title=title,
65
  examples=examples
 
21
  vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
22
  )
23
 
24
+ hoogelandsters_text2speech = Text2Speech.from_pretrained(
25
+ model_tag="https://huggingface.co/ahnafsamin/FastSpeech2-gronings-hoogelandsters/resolve/main/tts_train_fastspeech2_raw_char_tacotron_train.loss.ave.zip",
26
+ vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
27
+ )
28
+
29
  westerkwartiers_text2speech = Text2Speech.from_pretrained(
30
  model_tag="https://huggingface.co/ahnafsamin/FastSpeech2-gronings-westerkwartiers/resolve/main/tts_train_fastspeech2_raw_char_tacotron_train.loss.ave.zip",
31
  vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
 
41
  if lang == "gronings":
42
  wav = gos_text2speech(text)["wav"]
43
  scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
44
+ elif lang == "gronings hoogelandsters":
45
+ wav = hoogelandsters_text2speech(text)["wav"]
46
+ scipy.io.wavfile.write("out.wav", hoogelandsters_text2speech.fs , wav.view(-1).cpu().numpy())
47
  elif lang == "gronings westerkwartiers":
48
  wav = westerkwartiers_text2speech(text)["wav"]
49
  wav = wav * 15
 
67
 
68
  gr.Interface(
69
  inference,
70
+ [gr.inputs.Textbox(label="input text", lines=3), gr.inputs.Radio(choices=["gronings", "gronings hoogelandsters", "gronings westerkwartiers", "gronings oldambster"], type="value", default="gronings", label="language")],
71
  [gr.outputs.Audio(type="file", label="Output"), gr.outputs.File()],
72
  title=title,
73
  examples=examples