Sentdex commited on
Commit
a8a12e6
1 Parent(s): 35b3547

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -18,7 +18,7 @@ Here's a quick example of using this model:
18
 
19
  ```py
20
  from transformers import AutoTokenizer, AutoModelWithLMHead
21
-
22
  tokenizer = AutoTokenizer.from_pretrained("Sentdex/GPyT")
23
  model = AutoModelWithLMHead.from_pretrained("Sentdex/GPyT")
24
 
@@ -27,8 +27,8 @@ inp = """import"""
27
 
28
  newlinechar = "<N>"
29
  converted = inp.replace("\n", newlinechar)
30
- tokenized = tokenizer.encode(converted, return_tensors='pt').to("cuda")
31
- resp = model.generate(tokenized).to("cuda")
32
 
33
  decoded = tokenizer.decode(resp[0])
34
  reformatted = decoded.replace("<N>","\n")
 
18
 
19
  ```py
20
  from transformers import AutoTokenizer, AutoModelWithLMHead
21
+
22
  tokenizer = AutoTokenizer.from_pretrained("Sentdex/GPyT")
23
  model = AutoModelWithLMHead.from_pretrained("Sentdex/GPyT")
24
 
 
27
 
28
  newlinechar = "<N>"
29
  converted = inp.replace("\n", newlinechar)
30
+ tokenized = tokenizer.encode(converted, return_tensors='pt')
31
+ resp = model.generate(tokenized)
32
 
33
  decoded = tokenizer.decode(resp[0])
34
  reformatted = decoded.replace("<N>","\n")