johnoye742 commited on
Commit
f537c9e
1 Parent(s): 1483cd5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
  def greet(prompt):
5
- generator = pipeline(model='gpt2')
6
 
7
- return generator(prompt)
8
 
9
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
10
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import AutoTokenizer
3
 
4
  def greet(prompt):
5
+ tokenizer = AutoTokenizer.from_pretrained('bert-based-cased', return_tensors='tf')
6
 
7
+ return tokenizer(prompt)
8
 
9
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
10
  iface.launch()