--- license: bigcode-openrail-m language: - en library_name: transformers pipeline_tag: text-generation base_model: Kuantum-ai1/TinyCode1.1-164M-Python tags: - code - python --- # TinyCode1.2-164M-Python A small Python code-completion model, fine-tuned from [`Kuantum-ai1/TinyCode1.1-164M-Python`](https://huggingface.co/Kuantum-ai1/TinyCode1.1-164M-Python) (v1.1, which continues v1, itself fine-tuned from [`bigcode/tiny_starcoder_py`](https://huggingface.co/bigcode/tiny_starcoder_py)) on 115M tokens of filtered Python code. ## Training - Base model: `Kuantum-ai1/TinyCode1.1-164M-Python` (v1.1) - Data (115M tokens, single pass): about 20M tokens of instruction-style docstring-to-code pairs (Magicoder-OSS-Instruct, Magicoder-Evol-Instruct, self-oss-instruct-sc2) and the rest from [`jon-tow/starcoderdata-python-edu`](https://huggingface.co/datasets/jon-tow/starcoderdata-python-edu) (educational-quality Python files). - Filtering: valid Python (`ast.parse`), length and line-length limits, alphabetic-ratio check, exact deduplication, and removal of any sample that shares a normalized line (40+ chars) with HumanEval (prompt, solution, tests) or any MBPP split, or contains an MBPP task description (30 candidate samples removed). The packed data was re-scanned after tokenization as a final check. - Hardware: 2x NVIDIA T4 (DDP, fp16 mixed precision), sequence length 1024, batch 65k tokens, peak LR 4e-05, cosine schedule ## Evaluation Greedy decoding, pass@1 (%), identical harness for every model (max 200 new tokens, 10 s timeout per program). HumanEval uses the standard prompts; MBPP (500 test problems) is zero-shot with a docstring-style prompt containing the task and the first test, so numbers are not directly comparable with few-shot figures reported elsewhere. | Model | Params | HumanEval | MBPP | |---|---|---|---| | Base: bigcode/tiny_starcoder_py | 164M | 9.15 | 4.8 | | Kuantum-ai1/TinyCode1-164M-Python (v1) | 164M | 9.15 | 4.0 | | Kuantum-ai1/TinyCode1.2-164M-Python (v1.2, ours) | 164M | 0.0 | 8.8 | | Kuantum-ai1/TinyCode1.1-164M-Python (v1.1) | 164M | 0.0 | 9.8 | Compared with v1.1: HumanEval +0.00, MBPP -1.00 (absolute pass@1 points). Base numbers come from an earlier run of the same harness; v1.1 and v1.2 were evaluated together in the final run; v1 was measured earlier with the same harness. ## GGUF Not available. ## Usage ```python from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1.2-164M-Python") model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1.2-164M-Python") ids = tok("def fibonacci(n):", return_tensors="pt") print(tok.decode(model.generate(**ids, max_new_tokens=100)[0])) ``` ## Limitations Small model: it makes frequent mistakes and should not be relied on for production code. Generated code must be reviewed before use. ## License bigcode-openrail-m