Views
No views yet
transformers:1from transformers import AutoTokenizer, AutoModelWithLMHead
2
3tokenizer = AutoTokenizer.from_pretrained("lvwerra/codeparrot-small")
4model = AutoModelWithLMHead.from_pretrained("lvwerra/codeparrot-small")
5
6inputs = tokenizer("def hello_world():", return_tensors="pt")
7outputs = model(**inputs)pipeline:1from transformers import pipeline
2
3pipe = pipeline("text-generation", model="lvwerra/codeparrot-small")
4outputs = pipe("def hello_world():")| Config | Value |
|---|---|
| Batch size | 192 |
| Context size | 1024 |
| Training steps | 150'000 |
| Gradient accumulation | 1 |
| Gradient checkpointing | False |
| Learning rate | 5e-4 |
| Weight decay | 0.1 |
| Warmup steps | 2000 |
| Schedule | Cosine |
| Metric | Value |
|---|---|
| pass@1 | 3.80% |
| pass@10 | 6.57% |
| pass@100 | 12.78% |