Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,9 @@ import os
|
|
2 |
os.system("pip install gradio==3.3")
|
3 |
import gradio as gr
|
4 |
import numpy as np
|
5 |
-
|
|
|
|
|
6 |
|
7 |
title = "SpeechMatrix Speech-to-speech Translation"
|
8 |
|
@@ -21,7 +23,8 @@ for src in SRC_LIST:
|
|
21 |
examples = []
|
22 |
|
23 |
# io_dict = {model: gr.Interface.load(f"huggingface/facebook/{model}", api_key=st.secrets["api_key"]) for model in MODEL_LIST}
|
24 |
-
io_dict = {model: gr.Interface.load(f"huggingface/facebook/{model}") for model in MODEL_LIST}
|
|
|
25 |
|
26 |
def inference(audio, model):
|
27 |
out_audio = io_dict[model](audio)
|
|
|
2 |
os.system("pip install gradio==3.3")
|
3 |
import gradio as gr
|
4 |
import numpy as np
|
5 |
+
import streamlit as st
|
6 |
+
|
7 |
+
from fairseq.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub
|
8 |
|
9 |
title = "SpeechMatrix Speech-to-speech Translation"
|
10 |
|
|
|
23 |
examples = []
|
24 |
|
25 |
# io_dict = {model: gr.Interface.load(f"huggingface/facebook/{model}", api_key=st.secrets["api_key"]) for model in MODEL_LIST}
|
26 |
+
# io_dict = {model: gr.Interface.load(f"huggingface/facebook/{model}") for model in MODEL_LIST}
|
27 |
+
io_dict = {model: load_model_ensemble_and_task_from_hf_hub(f"facebook/{model}") for model in MODEL_LIST}
|
28 |
|
29 |
def inference(audio, model):
|
30 |
out_audio = io_dict[model](audio)
|