Run this model with HF Jobs
Run Kuantum-ai1/TinyCode1.1-164M-Python on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Kuantum-ai1/TinyCode1.1-164M-Python. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Kuantum-ai1/TinyCode1.1-164M-Python on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Kuantum-ai1/TinyCode1.1-164M-Python. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Kuantum-ai1/TinyCode1.1-164M-Python. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Kuantum-ai1/TinyCode1.1-164M-Python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kuantum-ai1/TinyCode1.1-164M-Python with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kuantum-ai1/TinyCode1.1-164M-Python")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python") model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kuantum-ai1/TinyCode1.1-164M-Python with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kuantum-ai1/TinyCode1.1-164M-Python" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuantum-ai1/TinyCode1.1-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kuantum-ai1/TinyCode1.1-164M-Python
- SGLang
How to use Kuantum-ai1/TinyCode1.1-164M-Python with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kuantum-ai1/TinyCode1.1-164M-Python" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuantum-ai1/TinyCode1.1-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kuantum-ai1/TinyCode1.1-164M-Python" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuantum-ai1/TinyCode1.1-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kuantum-ai1/TinyCode1.1-164M-Python with Docker Model Runner:
docker model run hf.co/Kuantum-ai1/TinyCode1.1-164M-Python
Upload folder using huggingface_hub
Browse filesFiles changed (6)
- README.mdAdded+59
- config.jsonAdded+42
- generation_config.jsonAdded+6
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+33
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859---license: bigcode-openrail-mlanguage:- enlibrary_name: transformerspipeline_tag: text-generationbase_model: Kuantum-ai1/TinyCode1-164M-Pythontags:- code- python---
# TinyCode1.1-164M-Python
A small Python code-completion model, fine-tuned from [`Kuantum-ai1/TinyCode1-164M-Python`](https://huggingface.co/Kuantum-ai1/TinyCode1-164M-Python) (v1, itself fine-tuned from [`bigcode/tiny_starcoder_py`](https://huggingface.co/bigcode/tiny_starcoder_py)) on 80M tokens of filtered Python code.
## Training
- Base model: `Kuantum-ai1/TinyCode1-164M-Python` (v1)- Data (80M tokens, single pass): about 10M tokens of instruction-style docstring-to-code pairs (Magicoder-OSS-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 (14 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 5e-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.1-164M-Python (v1.1, ours) | 164M | 0.0 | 9.8 || Kuantum-ai1/TinyCode1-164M-Python (v1) | 164M | 0.0 | 3.8 |
Compared with v1: HumanEval +0.00, MBPP +6.00 (absolute pass@1 points).
Base numbers come from an earlier run of the same harness; v1 and v1.1 were evaluated together in the final run.
## GGUF
Not available.
## Usage
```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizertok = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python")model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1.1-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-m123456789101112131415161718192021222324252627282930313233343536373839404142{ "activation_function": "gelu_pytorch_tanh", "add_cross_attention": false, "architectures": [ "GPTBigCodeForCausalLM" ], "attention_softmax_in_fp32": true, "attn_pdrop": 0.1, "bos_token_id": 0, "dtype": "float32", "embd_pdrop": 0.1, "eos_token_id": 0, "inference_runner": 0, "initializer_range": 0.02, "layer_norm_epsilon": 1e-05, "max_batch_size": null, "max_sequence_length": null, "model_type": "gpt_bigcode", "multi_query": true, "n_embd": 768, "n_head": 12, "n_inner": 3072, "n_layer": 20, "n_positions": 8192, "num_key_value_heads": 1, "pad_key_length": true, "pad_token_id": null, "pre_allocate_kv_cache": false, "resid_pdrop": 0.1, "scale_attention_softmax_in_fp32": true, "scale_attn_weights": true, "summary_activation": null, "summary_first_dropout": 0.1, "summary_proj_to_labels": true, "summary_type": "cls_index", "summary_use_proj": true, "tie_word_embeddings": true, "transformers_version": "5.20.2", "use_cache": false, "validate_runner_input": true, "vocab_size": 49152}123456{ "_from_model_config": true, "bos_token_id": 0, "eos_token_id": 0, "transformers_version": "5.20.2"}123version https://git-lfs.github.com/spec/v1oid sha256:e9ec7a6fbaec27e4728f9f8df5643cdde17486c497603d7721c51bdc9f5fa291size 656601304123456789101112131415161718192021222324252627282930313233{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "extra_special_tokens": [ "<|endoftext|>", "<fim_prefix>", "<fim_middle>", "<fim_suffix>", "<fim_pad>", "<filename>", "<gh_stars>", "<issue_start>", "<issue_comment>", "<issue_closed>", "<jupyter_start>", "<jupyter_text>", "<jupyter_code>", "<jupyter_output>", "<empty_output>", "<commit_before>", "<commit_msg>", "<commit_after>", "<reponame>" ], "is_local": false, "local_files_only": false, "model_max_length": 1000000000000000019884624838656, "tokenizer_class": "TokenizersBackend", "unk_token": "<|endoftext|>", "vocab_size": 49152}README.mdAdded+59
config.jsonAdded+42
generation_config.jsonAdded+6
model.safetensorsAdded+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+33