clarkchan commited on
Commit
0bdb91f
·
1 Parent(s): a634114
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,7 +1,9 @@
1
  import gradio as gr
2
-
 
3
  def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import AutoTokenizer
3
+ tokenizer = AutoTokenizer.from_pretrained("distilbert-base-finetuned-sst-2-english")
4
  def greet(name):
5
+ result = tokenizer([name],padding=True,truncation=True,return_tensors="pt")
6
+ return result.input_ids[0]
7
 
8
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
9
  iface.launch()