Text Generation
Transformers
Safetensors
GGUF
English
gpt_bigcode
code
python
text-generation-inference
Run this model with HF Jobs
Run Kuantum-ai1/TinyCode1-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-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-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-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.
Instructions to use Kuantum-ai1/TinyCode1-164M-Python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kuantum-ai1/TinyCode1-164M-Python with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kuantum-ai1/TinyCode1-164M-Python")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1-164M-Python") model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1-164M-Python", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Kuantum-ai1/TinyCode1-164M-Python with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M # Run inference directly in the terminal: llama cli -hf Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M # Run inference directly in the terminal: llama cli -hf Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
Use Docker
docker model run hf.co/Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Kuantum-ai1/TinyCode1-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-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-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
- SGLang
How to use Kuantum-ai1/TinyCode1-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-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-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-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-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use Kuantum-ai1/TinyCode1-164M-Python with Ollama:
ollama run hf.co/Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Kuantum-ai1/TinyCode1-164M-Python with Docker Model Runner:
docker model run hf.co/Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
- Lemonade
How to use Kuantum-ai1/TinyCode1-164M-Python with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Kuantum-ai1/TinyCode1-164M-Python:Q4_K_M
Run and chat with the model
lemonade run user.TinyCode1-164M-Python-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload folder using huggingface_hub
Browse filesFiles changed (10)
- .gitattributes+3
- README.mdAdded+58
- TinyCode1-164M-Python-Q4_0.ggufAdded+3
- TinyCode1-164M-Python-Q4_K_M.ggufAdded+3
- TinyCode1-164M-Python-Q8_0.ggufAdded+3
- config.jsonAdded+42
- generation_config.jsonAdded+6
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+33
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines33343536373832 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textTinyCode1-164M-Python-Q4_0.gguf filter=lfs diff=lfs merge=lfs -textTinyCode1-164M-Python-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -textTinyCode1-164M-Python-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758---license: bigcode-openrail-mlanguage:- enlibrary_name: transformerspipeline_tag: text-generationbase_model: bigcode/tiny_starcoder_pydatasets:- codeparrot/codeparrot-cleantags:- code- python---
# TinyCode1-164M-Python
A small Python code-completion model, fine-tuned from [`bigcode/tiny_starcoder_py`](https://huggingface.co/bigcode/tiny_starcoder_py) on about 35M tokens of Python source code.
## Training
- Base model: `bigcode/tiny_starcoder_py`- Dataset: [`codeparrot/codeparrot-clean`](https://huggingface.co/datasets/codeparrot/codeparrot-clean) (English-language Python source files, 35M tokens, 1 epoch)- Hardware: 2x NVIDIA T4 (DDP, fp16 mixed precision), sequence length 1024, 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 | 0.61 | 5.2 |
The base model is included to show the effect of fine-tuning.
## GGUF
- `TinyCode1-164M-Python-Q4_0.gguf`- `TinyCode1-164M-Python-Q4_K_M.gguf`- `TinyCode1-164M-Python-Q8_0.gguf`
## Usage
```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizertok = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1-164M-Python")model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1-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-m123version https://git-lfs.github.com/spec/v1oid sha256:d4a77129d4234fcc436f225e8a907ac24ff40d28546c0563c0bea5f0a65c745dsize 126017920123version https://git-lfs.github.com/spec/v1oid sha256:8faf9eb20f969d9ed2cba45127c0d2719f3d67c427a314a049052531a6e0a970size 133874560123version https://git-lfs.github.com/spec/v1oid sha256:6605d29450d2ebbe906244fee3ae8dda9cfaffe643b8e389d5b2d0de38f02095size 195125632123456789101112131415161718192021222324252627282930313233343536373839404142{ "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:d6365d7088a2977c9f6f5c8c8305012c8e4aab1dbd71b61bb79e1154760f4b37size 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}.gitattributes+3
README.mdAdded+58
TinyCode1-164M-Python-Q4_0.ggufAdded+3
TinyCode1-164M-Python-Q4_K_M.ggufAdded+3
TinyCode1-164M-Python-Q8_0.ggufAdded+3
config.jsonAdded+42
generation_config.jsonAdded+6
model.safetensorsAdded+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+33