Spaces:
Runtime error
Runtime error
kevinwang676
commited on
Commit
•
c12f742
1
Parent(s):
b3a3c8a
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ os.system("pip install numpy==1.22.0")
|
|
7 |
from modelscope.models.audio.tts import SambertHifigan
|
8 |
from modelscope.pipelines import pipeline
|
9 |
from modelscope.utils.constant import Tasks
|
|
|
10 |
|
11 |
model_dir = os.path.abspath("./pretrain_work_dir")
|
12 |
|
@@ -35,7 +36,8 @@ inference = pipeline(task=Tasks.text_to_speech, model=model_id)
|
|
35 |
|
36 |
def infer(text):
|
37 |
output = inference(input=text)
|
38 |
-
|
|
|
39 |
|
40 |
app = gr.Blocks()
|
41 |
|
|
|
7 |
from modelscope.models.audio.tts import SambertHifigan
|
8 |
from modelscope.pipelines import pipeline
|
9 |
from modelscope.utils.constant import Tasks
|
10 |
+
import IPython.display as ipd
|
11 |
|
12 |
model_dir = os.path.abspath("./pretrain_work_dir")
|
13 |
|
|
|
36 |
|
37 |
def infer(text):
|
38 |
output = inference(input=text)
|
39 |
+
audio = ipd.Audio(output["output_wav"], rate=16000)
|
40 |
+
return audio
|
41 |
|
42 |
app = gr.Blocks()
|
43 |
|