reallynicejam's picture
Update app.py
7efca7c verified
raw
history blame
No virus
498 Bytes
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()