Ahsen Khaliq commited on
Commit
28542e1
1 Parent(s): 40c1f16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -3
app.py CHANGED
@@ -12,8 +12,47 @@ examples = [
12
  ["Hello this is a test run"]
13
  ]
14
 
15
- gr.Interface.load("huggingface/facebook/fastspeech2-en-200_speaker-cv4", examples=examples,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  article=article,
17
  title=title,
18
- description=description,
19
- enable_queue=True).launch()
 
12
  ["Hello this is a test run"]
13
  ]
14
 
15
+ io1 = gr.Interface.load("huggingface/facebook/fastspeech2-en-200_speaker-cv4")
16
+
17
+ io2 = gr.Interface.load("huggingface/facebook/tts_transformer-en-200_speaker-cv4")
18
+
19
+ io3 = gr.Interface.load("huggingface/facebook/tts_transformer-zh-cv7_css10")
20
+
21
+ io4 = gr.Interface.load("huggingface/facebook/tts_transformer-fr-cv7_css10")
22
+
23
+ io5 = gr.Interface.load("huggingface/facebook/tts_transformer-ru-cv7_css10")
24
+
25
+ io6 = gr.Interface.load("huggingface/facebook/tts_transformer-tr-cv7")
26
+
27
+
28
+
29
+
30
+
31
+
32
+ def inference(text,model):
33
+ if model == "fastspeech2-en-200_speaker-cv4":
34
+ outtext = io1(text)
35
+ elif model == "tts_transformer-en-200_speaker-cv4":
36
+ outtext = io2(text)
37
+ elif model == "tts_transformer-zh-cv7_css10":
38
+ outtext = io3(text)
39
+ elif model == "tts_transformer-fr-cv7_css10":
40
+ outtext = io4(text)
41
+ elif model == "tts_transformer-fr-cv7_css10":
42
+ outtext = io4(text)
43
+ else:
44
+ outtext = io2(text)
45
+ else:
46
+ outtext = io2(text)
47
+ return outtext
48
+
49
+
50
+ gr.Interface(
51
+ inference,
52
+ [gr.inputs.Textbox(label="Input",lines=5),gr.inputs.Dropdown(choices=["mt5-small-finetuned-arxiv-cs-finetuned-arxiv-cs-full","mT5_multilingual_XLSum"], type="value", default="mt5-small-finetuned-arxiv-cs-finetuned-arxiv-cs-full", label="model")
53
+ ],
54
+ gr.outputs.Textbox(label="Output"),
55
+ examples=examples,
56
  article=article,
57
  title=title,
58
+ description=description).launch(enable_queue=True, cache_examples=True)