Spaces:
Configuration error
Configuration error
try: loading model inside inference
Browse files
app.py
CHANGED
@@ -2,27 +2,17 @@ import os
|
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
|
5 |
-
|
6 |
-
io1 = gr.load("huggingface/facebook/xm_transformer_s2ut_en-hk")
|
7 |
-
io2 = gr.load("huggingface/facebook/xm_transformer_s2ut_hk-en")
|
8 |
-
io3 = gr.load("huggingface/facebook/xm_transformer_unity_en-hk")
|
9 |
-
io4 = gr.load("huggingface/facebook/xm_transformer_unity_hk-en")
|
10 |
-
|
11 |
def inference(audio, model):
|
12 |
-
|
13 |
-
print(f"[DEBUG] audio type: {type(audio)}")
|
14 |
-
print(f"[DEBUG] model: {model}")
|
15 |
-
out_audio = None
|
16 |
if model == "xm_transformer_s2ut_en-hk":
|
17 |
-
|
18 |
elif model == "xm_transformer_s2ut_hk-en":
|
19 |
-
|
20 |
elif model == "xm_transformer_unity_en-hk":
|
21 |
-
|
22 |
else:
|
23 |
-
|
24 |
-
|
25 |
-
print(f"[DEBUG] out type: {type(out_audio)}")
|
26 |
return out_audio
|
27 |
|
28 |
|
|
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
def inference(audio, model):
|
6 |
+
io = None
|
|
|
|
|
|
|
7 |
if model == "xm_transformer_s2ut_en-hk":
|
8 |
+
io = gr.load("huggingface/facebook/xm_transformer_s2ut_en-hk")
|
9 |
elif model == "xm_transformer_s2ut_hk-en":
|
10 |
+
io = gr.load("huggingface/facebook/xm_transformer_s2ut_hk-en")
|
11 |
elif model == "xm_transformer_unity_en-hk":
|
12 |
+
io = gr.load("huggingface/facebook/xm_transformer_unity_en-hk")
|
13 |
else:
|
14 |
+
io = gr.load("huggingface/facebook/xm_transformer_unity_hk-en")
|
15 |
+
out_audio = io(audio)
|
|
|
16 |
return out_audio
|
17 |
|
18 |
|