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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -44
app.py CHANGED
@@ -1,5 +1,3 @@
1
- import os
2
- os.system("pip install gradio==2.4.6")
3
  import gradio as gr
4
 
5
  title = "FastSpeech2"
@@ -12,47 +10,7 @@ examples = [
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)
 
 
 
1
  import gradio as gr
2
 
3
  title = "FastSpeech2"
 
10
  ["Hello this is a test run"]
11
  ]
12
 
13
+ gr.Interface.load("huggingface/facebook/fastspeech2-en-200_speaker-cv4", examples=examples,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  article=article,
15
  title=title,
16
+ description=description).launch(enable_queue=True)