update
Browse files- architectures/codeparrot.txt +23 -1
architectures/codeparrot.txt
CHANGED
@@ -3,4 +3,26 @@
|
|
3 |
|Model | # parameters |
|
4 |
| - | - |
|
5 |
| GPT2 | 110M |
|
6 |
-
| GPT2 | 1.5B |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|Model | # parameters |
|
4 |
| - | - |
|
5 |
| GPT2 | 110M |
|
6 |
+
| GPT2 | 1.5B |
|
7 |
+
|
8 |
+
You can load the model and tokenizer directly from the `transformers`:
|
9 |
+
|
10 |
+
```python
|
11 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead
|
12 |
+
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained("lvwerra/codeparrot")
|
14 |
+
model = AutoModelWithLMHead.from_pretrained("lvwerra/codeparrot")
|
15 |
+
|
16 |
+
inputs = tokenizer("def hello_world():", return_tensors="pt")
|
17 |
+
outputs = model(**inputs)
|
18 |
+
|
19 |
+
```
|
20 |
+
|
21 |
+
Or you can use a pipeline
|
22 |
+
|
23 |
+
```python
|
24 |
+
from transformers import pipeline
|
25 |
+
|
26 |
+
pipe = pipeline("text-generation", model="lvwerra/codeparrot")
|
27 |
+
outputs = pipe("def hello_world():")
|
28 |
+
```
|