Spaces:
Runtime error
Runtime error
File size: 734 Bytes
8cb6e2d d867b66 a67a8ac 3f873d4 8cb6e2d 3f873d4 8cb6e2d 3f873d4 8cb6e2d 3f873d4 8cb6e2d 3f873d4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import os
import gradio as gr
SRC_LIST = ['cs', 'de', 'en', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'it', 'nl', 'pl', 'pt', 'ro', 'sk', 'sl']
TGT_LIST = ['en', 'fr', 'es']
MODEL_LIST = ['xm_transformer_sm_all-en']
for src in SRC_LIST:
for tgt in TGT_LIST:
if src != tgt:
MODEL_LIST.append(f"textless_sm_{src}_{tgt}")
examples = []
io_dict = {model: gr.load(f"huggingface/facebook/{model}") for model in MODEL_LIST}
def inference(audio, model):
out_audio = io_dict[model](audio)
return out_audio
gr.Interface(
inference,
[gr.Audio(source="microphone", type="filepath", label="Input"),gr.Dropdown(choices=MODEL_LIST, type="value", label="Model")
],
gr.Audio(label="Output")).queue().launch() |