kreem22 commited on
Commit
1563fce
β€’
1 Parent(s): e90d67c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoTokenizer, AutoModelForCausalLM
2
+
3
+ tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
4
+ model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")
5
+
6
+ text = "Tell a story"
7
+
8
+ encoded_input = tokenizer(text, return_tensors='pt')
9
+
10
+ output = model(**encoded_input)