File size: 451 Bytes
05c44f6
232fc9c
8693057
05c44f6
 
8693057
 
 
59e0b55
8693057
 
05c44f6
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
#from transformers import AutoTokenizer
from transformers import pipeline

def greet(name):
    #tokenizer = AutoTokenizer.from_pretrained("KoichiYasuoka/roberta-base-thai-char-upos")
    #t = tokenizer.tokenize(name)
    translator = pipeline("translation_en_to_de")
    return translator(name)

    #return "Hello ครับ คุณ" + name + "! "

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()