File size: 512 Bytes
05c44f6 232fc9c 8693057 05c44f6 8693057 05c44f6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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")
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() |