Erfan11 commited on
Commit
55ea44d
1 Parent(s): fa2bc55

Create Openai.ai

Browse files
Files changed (1) hide show
  1. Openai.ai +9 -0
Openai.ai ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Use a pipeline as a high-level helper
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline("text-generation", model="openai-community/gpt2")
5
+ # Load model directly
6
+ from transformers import AutoTokenizer, AutoModelForCausalLM
7
+
8
+ tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
9
+ model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")