Views
No views yet
Salesforce/codet5p-220m
for automatically generating PyTest-style unit tests from Python functions.| Epoch | Eval Loss |
|---|---|
| 1 | 1.6184 |
| 2 | 1.6293 |
| 3 | 1.6267 |
| 4 | 1.6255 |
| 5 | 1.6253 |
| 6 | 1.6275 |
1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3repo = "Oluwaferanmiii/codet5p-220m-pytest-generator"
4
5tokenizer = AutoTokenizer.from_pretrained(repo)
6model = AutoModelForSeq2SeqLM.from_pretrained(repo)
7
8prompt = (
9 "Given this Python function:\n```python\n"
10 "def add(a, b):\n return a + b\n"
11 "```, write a PyTest unit test function in Python with at least one assert "
12 "statement to verify its behavior."
13)
14
15inputs = tokenizer(prompt, return_tensors="pt")
16outputs = model.generate(**inputs, max_new_tokens=256)
17
18print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@misc{akinwale2025codet5pytest,
2 author = {Akinwale, Oluwaferanmi Philip},
3 title = {CodeT5p-220m PyTest Generator},
4 year = {2025},
5 note = {Hugging Face model repository},
6 url = {https://huggingface.co/Oluwaferanmiii/codet5p-220m-pytest-generator}
7}