akhaliq HF staff commited on
Commit
b8c6cbb
1 Parent(s): 83cc343

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
app.py CHANGED
@@ -17,38 +17,38 @@ examples = [
17
  ["Hola, esta es una prueba.","tts_transformer-es-css10"]
18
  ]
19
 
20
- io1 = gr.Interface.load("huggingface/facebook/fastspeech2-en-200_speaker-cv4")
21
 
22
- io2 = gr.Interface.load("huggingface/facebook/tts_transformer-en-200_speaker-cv4")
23
 
24
- io3 = gr.Interface.load("huggingface/facebook/tts_transformer-fr-cv7_css10")
25
 
26
- io4 = gr.Interface.load("huggingface/facebook/tts_transformer-ru-cv7_css10")
27
 
28
- io5 = gr.Interface.load("huggingface/facebook/tts_transformer-tr-cv7")
29
 
30
- io6 = gr.Interface.load("huggingface/facebook/tts_transformer-vi-cv7")
31
 
32
- io7 = gr.Interface.load("huggingface/facebook/tts_transformer-ar-cv7")
33
 
34
- io8 = gr.Interface.load("huggingface/facebook/tts_transformer-es-css10")
35
 
36
 
37
 
38
  def inference(text,model):
39
- if model == "fastspeech2-en-200_speaker-cv4":
40
  outtext = io1(text)
41
- elif model == "tts_transformer-en-200_speaker-cv4":
42
  outtext = io2(text)
43
- elif model == "tts_transformer-fr-cv7_css10":
44
  outtext = io3(text)
45
- elif model == "tts_transformer-ru-cv7_css10":
46
  outtext = io4(text)
47
- elif model == "tts_transformer-tr-cv7":
48
  outtext = io5(text)
49
- elif model == "tts_transformer-vi-cv7":
50
  outtext = io6(text)
51
- elif model == "tts_transformer-ar-cv7":
52
  outtext = io7(text)
53
  else:
54
  outtext = io8(text)
@@ -57,11 +57,10 @@ def inference(text,model):
57
 
58
  gr.Interface(
59
  inference,
60
- [gr.inputs.Textbox(label="Input",lines=5),gr.inputs.Dropdown(choices=["fastspeech2-en-200_speaker-cv4","tts_transformer-en-200_speaker-cv4","tts_transformer-tr-cv7","tts_transformer-fr-cv7_css10","tts_transformer-ru-cv7_css10","tts_transformer-vi-cv7","tts_transformer-ar-cv7","tts_transformer-es-css10"], type="value", default="fastspeech2-en-200_speaker-cv4", label="model")
61
  ],
62
  gr.outputs.Audio(label="Output"),
63
  examples=examples,
64
  article=article,
65
  title=title,
66
- description=description,
67
- enable_queue=True).launch()
 
17
  ["Hola, esta es una prueba.","tts_transformer-es-css10"]
18
  ]
19
 
20
+ io1 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-es_en-multi_domain")
21
 
22
+ io2 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-ru_en-multi_domain")
23
 
24
+ io3 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-en_ru-multi_domain")
25
 
26
+ io4 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-en_es-multi_domain")
27
 
28
+ io5 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-en_zh-multi_domain")
29
 
30
+ io6 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-fr_en-multi_domain")
31
 
32
+ io7 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-en_ar-multi_domain")
33
 
34
+ io8 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-en_tr-multi_domain")
35
 
36
 
37
 
38
  def inference(text,model):
39
+ if model == "xm_transformer_600m-es_en-multi_domain":
40
  outtext = io1(text)
41
+ elif model == "xm_transformer_600m-ru_en-multi_domain":
42
  outtext = io2(text)
43
+ elif model == "xm_transformer_600m-en_ru-multi_domain":
44
  outtext = io3(text)
45
+ elif model == "xm_transformer_600m-en_es-multi_domain":
46
  outtext = io4(text)
47
+ elif model == "xm_transformer_600m-en_zh-multi_domain":
48
  outtext = io5(text)
49
+ elif model == "xm_transformer_600m-fr_en-multi_domain":
50
  outtext = io6(text)
51
+ elif model == "xm_transformer_600m-en_ar-multi_domain":
52
  outtext = io7(text)
53
  else:
54
  outtext = io8(text)
 
57
 
58
  gr.Interface(
59
  inference,
60
+ [gr.inputs.Audio(label="Input"),gr.inputs.Dropdown(choices=["xm_transformer_600m-es_en-multi_domain","xm_transformer_600m-ru_en-multi_domain","xm_transformer_600m-en_ru-multi_domain","xm_transformer_600m-en_es-multi_domain","xm_transformer_600m-en_zh-multi_domain","xm_transformer_600m-fr_en-multi_domain","xm_transformer_600m-en_ar-multi_domain","facebook/xm_transformer_600m-en_tr-multi_domain"], type="value", default="xm_transformer_600m-es_en-multi_domain", label="model")
61
  ],
62
  gr.outputs.Audio(label="Output"),
63
  examples=examples,
64
  article=article,
65
  title=title,
66
+ description=description).launch(enable_queue=True)