stellaathena commited on
Commit
7cb5428
1 Parent(s): 8a44d5a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -4
README.md CHANGED
@@ -52,12 +52,14 @@ GPT-J learns an inner representation of the English language that can be used to
52
 
53
  ### How to use
54
 
55
- You can use this model directly with a pipeline for text generation. This example generates a different sequence each time it's run:
56
 
57
  ```python
58
- >>> from transformers import pipeline
59
- >>> generator = pipeline('text-generation', model='EleutherAI/gpt-j-6B')
60
- >>> generator("EleutherAI has", do_sample=True, min_length=50)
 
 
61
 
62
  [{'generated_text': 'EleutherAI has made a commitment to create new software packages for each of its major clients and has'}]
63
  ```
 
52
 
53
  ### How to use
54
 
55
+ This model can be easily loaded using the `AutoModelForCausalLM` functionality:
56
 
57
  ```python
58
+ from transformers import AutoTokenizer, AutoModelForCausalLM
59
+
60
+ tokenizer = AutoTokenizer.from_pretrained("gpt2")
61
+ model = AutoModelForCausalLM.from_pretrained("gpt-j-6B")
62
+
63
 
64
  [{'generated_text': 'EleutherAI has made a commitment to create new software packages for each of its major clients and has'}]
65
  ```