af1tang celex commited on
Commit
2b9c48d
1 Parent(s): 32254a3

Update Getting Started code as previous version doesn't work anymore (#4)

Browse files

- Update Getting Started code as previous version doesn't work anymore (f7d1a692f0b87d3c75ada8e02e7dbd3c94fe7434)


Co-authored-by: Ankit Sharma <celex@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -24,10 +24,10 @@ Preprocessing, training and implementation details can be found in the [personaG
24
  ```python
25
  from transformers import GPT2Tokenizer, GPT2LMHeadModel
26
  import torch
27
- tokenizer = AutoTokenizer.from_pretrained("af1tang/personaGPT")
28
- model = AutoModelForCausalLM.from_pretrained("af1tang/personaGPT")
29
  if torch.cuda.is_available():
30
- model = model.cuda()
31
  ## utility functions ##
32
  flatten = lambda l: [item for sublist in l for item in sublist]
33
 
 
24
  ```python
25
  from transformers import GPT2Tokenizer, GPT2LMHeadModel
26
  import torch
27
+ tokenizer = GPT2Tokenizer.from_pretrained("af1tang/personaGPT")
28
+ model = GPT2LMHeadModel.from_pretrained("af1tang/personaGPT")
29
  if torch.cuda.is_available():
30
+ model = model.cuda()
31
  ## utility functions ##
32
  flatten = lambda l: [item for sublist in l for item in sublist]
33