Spaces:
Runtime error
Runtime error
update namespace
Browse files
architectures/codeparrot.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
[CodeParrot](https://huggingface.co/
|
2 |
|
3 |
<div align="center">
|
4 |
|
5 |
|Model | # parameters |
|
6 |
| - | - |
|
7 |
-
| [codeparrot-small](https://huggingface.co/
|
8 |
-
| [codeparrot](https://huggingface.co/
|
9 |
|
10 |
</div>
|
11 |
|
@@ -15,8 +15,8 @@ You can load the model and tokenizer directly from 🤗 [`transformers`](https:/
|
|
15 |
```python
|
16 |
from transformers import AutoTokenizer, AutoModelWithLMHead
|
17 |
|
18 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
19 |
-
model = AutoModelWithLMHead.from_pretrained("
|
20 |
|
21 |
inputs = tokenizer("def hello_world():", return_tensors="pt")
|
22 |
outputs = model(**inputs)
|
@@ -28,6 +28,6 @@ You can also use `pipeline` to generate code:
|
|
28 |
```python
|
29 |
from transformers import pipeline
|
30 |
|
31 |
-
pipe = pipeline("text-generation", model="
|
32 |
outputs = pipe("def hello_world():")
|
33 |
```
|
|
|
1 |
+
[CodeParrot](https://huggingface.co/codeparrot/codeparrot) uses GPT-2 architecture with BPE tokenizer trained on Python code from the training split of the data, and a context length of 1024. This model was released as an educational tool for training large language models from scratch on code, with detailed tutorials and descriptions of the training process. It makes use of 🤗 [`accelerate`](https://huggingface.co/docs/accelerate/index) for distributed training and mixed precision. See this [blog](https://huggingface.co/blog/codeparrot) and [repo](https://github.com/huggingface/transformers/tree/main/examples/research_projects/codeparrot) for more details.
|
2 |
|
3 |
<div align="center">
|
4 |
|
5 |
|Model | # parameters |
|
6 |
| - | - |
|
7 |
+
| [codeparrot-small](https://huggingface.co/codeparrot/codeparrot-small) | 110M |
|
8 |
+
| [codeparrot](https://huggingface.co/codeparrot/codeparrot) | 1.5B |
|
9 |
|
10 |
</div>
|
11 |
|
|
|
15 |
```python
|
16 |
from transformers import AutoTokenizer, AutoModelWithLMHead
|
17 |
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained("codeparrot/codeparrot")
|
19 |
+
model = AutoModelWithLMHead.from_pretrained("codeparrot/codeparrot")
|
20 |
|
21 |
inputs = tokenizer("def hello_world():", return_tensors="pt")
|
22 |
outputs = model(**inputs)
|
|
|
28 |
```python
|
29 |
from transformers import pipeline
|
30 |
|
31 |
+
pipe = pipeline("text-generation", model="codeparrot/codeparrot")
|
32 |
outputs = pipe("def hello_world():")
|
33 |
```
|