trans / app.py
dffdfdreter's picture
Update app.py
dbbacff verified
raw
history blame
387 Bytes
import gradio as gr
from huggingface_hub import InferenceClient
def frenchtranslator(message, history):
client = InferenceClient(model="Helsinki-NLP/opus-mt-vi-en")
message = client.translation(message).translation_text
return message
with gr.Blocks(theme=gr.themes.Soft) as app:
gr.ChatInterface(fn=frenchtranslator, type="messages")
app.launch(debug=True, share=True)