language / app.py
willco-afk's picture
Create app.py
eb59b63 verified
raw
history blame
440 Bytes
import gradio as gr
from transformers import pipeline
# Define the model path in Hugging Face
model_name = "willco-afk/languages" # Ensure this is correct for your uploaded model
translator = pipeline("translation", model=model_name)
def translate(input_text):
return translator(input_text)[0]['translation_text']
# Define Gradio Interface
iface = gr.Interface(fn=translate, inputs="text", outputs="text", live=True)
iface.launch()