Spaces:
Sleeping
Sleeping
import gradio as gr | |
# Load the model | |
model = gr.load("models/facebook/xm_transformer_s2ut_hk-en") | |
# Define the translation function | |
def translate_hokkien_to_english(audio): | |
# Perform the translation using the loaded model | |
translation = model.predict(audio) | |
return translation | |
# Create a Gradio interface with a microphone input | |
iface = gr.Interface( | |
fn=translate_hokkien_to_english, | |
inputs=gr.Microphone(), | |
outputs="text" | |
) | |
# Launch the Gradio interface | |
iface.launch() | |