File size: 349 Bytes
5a3ebe3
0bdb91f
 
5a3ebe3
0bdb91f
 
5a3ebe3
 
 
1
2
3
4
5
6
7
8
9
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()