reshav1 commited on
Commit
04020fa
·
verified ·
1 Parent(s): 1ddef5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,10 +1,9 @@
1
  import transformers
2
- from transformers import GPT2Model
3
  model_id = "gpt2"
4
 
5
- model = GPT2Model.from_pretrained('gpt2')
6
 
7
  text = "Hello"
8
 
9
- outputs = model(text)
10
- print(outputs)
 
1
  import transformers
2
+ from transformers import GPT2LMHeadModel
3
  model_id = "gpt2"
4
 
5
+ model = GPT2LMHeadModel.from_pretrained(model_id)
6
 
7
  text = "Hello"
8
 
9
+ outputs = model(encoded_text)