File size: 308 Bytes
211522e
 
 
7f2a4c3
211522e
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from transformers import pipeline
import gradio as grad

model_name = "Helsinki-NLP/opus-mt-ko-en"
opus_translator = pipeline("translation", model=model_name)

def translate(text):
    response = opus_translator(text)
    return response

grad.Interface(translate, inputs=["text"], outputs=["text"]).launch()