Jack Lau commited on
Commit
f2c9def
1 Parent(s): 4e88cf4

Add application file

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,5 +1,8 @@
1
  import gradio as gr
 
2
  from transformers import BertTokenizer, GPT2LMHeadModel,TextGenerationPipeline
 
 
3
 
4
  def greet(name):
5
  return "Hello " + name + "!!"
 
1
  import gradio as gr
2
+
3
  from transformers import BertTokenizer, GPT2LMHeadModel,TextGenerationPipeline
4
+ tokenizer = BertTokenizer.from_pretrained("uer/gpt2-chinese-poem")
5
+ model = GPT2LMHeadModel.from_pretrained("uer/gpt2-chinese-poem")
6
 
7
  def greet(name):
8
  return "Hello " + name + "!!"