|
|
|
from transformers import pipeline |
|
import gradio as gr |
|
|
|
model_checkpoint = "suyash2102/model-en-to-fr" |
|
translator = pipeline("translation", model=model_checkpoint) |
|
def translation(text): |
|
return translator(text)[0]['translation_text'] |
|
|
|
iface = gr.Interface( |
|
fn=translation, |
|
inputs=gr.inputs.Textbox(label="Input English Text"), |
|
outputs=gr.outputs.Textbox(label="Translated French Text"), |
|
title="English to French Translation", |
|
description="Translate English text to French using a fine-tuned model.", |
|
) |
|
|
|
|
|
iface.launch() |