mao / app.py
Jira's picture
Update app.py
3dca51d
raw
history blame
538 Bytes
import gradio as gr
#from transformers import AutoTokenizer
!pip install transformers
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")
text = "Hello world! Hugging Face is the best NLP tool."
return translator(text)
#return "Hello ครับ คุณ" + name + "! "
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()