TinyCode1.2-164M-Python
a tiny model for code generation
2 min readupdated
This compact model is designed for Python code auto-completion and continues the TinyCode line based on the bigcode/tiny_starcoder_py architecture. Version 1.2 was trained on 115 million tokens of filtered code, including training datasets and docstring-to-code instruction pairs. With a very modest size of 164M parameters, the model runs efficiently on minimal resources. It is well-suited for developers, researchers, and anyone experimenting with lightweight language models for local coding assistance.
Key features
- Compact size of just 164M parameters for fast local execution.
- Trained on a 115M token dataset of strictly filtered Python code.
- Fine-tuned on top of version 1.1 using instruction data and educational repositories.
- Limitations of a small model: frequent errors are possible, and generated code requires mandatory review.
What you can do
- Integrate the model into a local development environment or test scripts for Python function auto-completion.
- Use string descriptions (docstrings) to generate basic function logic and scripts.
- Benchmark and compare code generation results against other ultra-small models.
Example
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]))
Read more
DetailsBenchmarks (pass@1): HumanEval — 0.0%, MBPP — 8.8%.
Training hardware: 2x NVIDIA T4 (DDP, fp16 mixed precision).
Training dataset: 115M tokens (including Magicoder and starcoderdata-python-edu).
License: bigcode-openrail-m.










Comments