Update README.md
Browse files
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')
|
31 |
-
resp = model.generate(tokenized)
|
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")
|