clarkchan's picture
ok
0bdb91f
raw
history blame
349 Bytes
import gradio as gr
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-finetuned-sst-2-english")
def greet(name):
result = tokenizer([name],padding=True,truncation=True,return_tensors="pt")
return result.input_ids[0]
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()