mao / app.py
Jira's picture
Update app.py
98361d5
raw
history blame
500 Bytes
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)
op = ""
for w in t:
op = op + "/" + w
return "Hello ครับ คุณ" + op + "! "
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()