Text Generation
Transformers
Safetensors
GGUF
English
gpt_bigcode
code
python
text-generation-inference
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 files- .gitattributes +3 -0
- README.md +58 -0
- TinyCode1-164M-Python-Q4_0.gguf +3 -0
- TinyCode1-164M-Python-Q4_K_M.gguf +3 -0
- TinyCode1-164M-Python-Q8_0.gguf +3 -0
- config.json +42 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +33 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
TinyCode1-164M-Python-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
TinyCode1-164M-Python-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
TinyCode1-164M-Python-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: bigcode-openrail-m
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
base_model: bigcode/tiny_starcoder_py
|
| 8 |
+
datasets:
|
| 9 |
+
- codeparrot/codeparrot-clean
|
| 10 |
+
tags:
|
| 11 |
+
- code
|
| 12 |
+
- python
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# TinyCode1-164M-Python
|
| 16 |
+
|
| 17 |
+
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.
|
| 18 |
+
|
| 19 |
+
## Training
|
| 20 |
+
|
| 21 |
+
- Base model: `bigcode/tiny_starcoder_py`
|
| 22 |
+
- Dataset: [`codeparrot/codeparrot-clean`](https://huggingface.co/datasets/codeparrot/codeparrot-clean) (English-language Python source files, 35M tokens, 1 epoch)
|
| 23 |
+
- Hardware: 2x NVIDIA T4 (DDP, fp16 mixed precision), sequence length 1024, peak LR 5e-05, cosine schedule
|
| 24 |
+
|
| 25 |
+
## Evaluation
|
| 26 |
+
|
| 27 |
+
Greedy decoding, pass@1 (%), identical harness for every model (max 200 new tokens, 10 s timeout per program).
|
| 28 |
+
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.
|
| 29 |
+
|
| 30 |
+
| Model | Params | HumanEval | MBPP |
|
| 31 |
+
|---|---|---|---|
|
| 32 |
+
| Base: bigcode/tiny_starcoder_py | 164M | 0.61 | 5.2 |
|
| 33 |
+
|
| 34 |
+
The base model is included to show the effect of fine-tuning.
|
| 35 |
+
|
| 36 |
+
## GGUF
|
| 37 |
+
|
| 38 |
+
- `TinyCode1-164M-Python-Q4_0.gguf`
|
| 39 |
+
- `TinyCode1-164M-Python-Q4_K_M.gguf`
|
| 40 |
+
- `TinyCode1-164M-Python-Q8_0.gguf`
|
| 41 |
+
|
| 42 |
+
## Usage
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 46 |
+
tok = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1-164M-Python")
|
| 47 |
+
model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1-164M-Python")
|
| 48 |
+
ids = tok("def fibonacci(n):", return_tensors="pt")
|
| 49 |
+
print(tok.decode(model.generate(**ids, max_new_tokens=100)[0]))
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Limitations
|
| 53 |
+
|
| 54 |
+
Small model: it makes frequent mistakes and should not be relied on for production code. Generated code must be reviewed before use.
|
| 55 |
+
|
| 56 |
+
## License
|
| 57 |
+
|
| 58 |
+
bigcode-openrail-m
|
TinyCode1-164M-Python-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d4a77129d4234fcc436f225e8a907ac24ff40d28546c0563c0bea5f0a65c745d
|
| 3 |
+
size 126017920
|
TinyCode1-164M-Python-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8faf9eb20f969d9ed2cba45127c0d2719f3d67c427a314a049052531a6e0a970
|
| 3 |
+
size 133874560
|
TinyCode1-164M-Python-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6605d29450d2ebbe906244fee3ae8dda9cfaffe643b8e389d5b2d0de38f02095
|
| 3 |
+
size 195125632
|
config.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_pytorch_tanh",
|
| 3 |
+
"add_cross_attention": false,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPTBigCodeForCausalLM"
|
| 6 |
+
],
|
| 7 |
+
"attention_softmax_in_fp32": true,
|
| 8 |
+
"attn_pdrop": 0.1,
|
| 9 |
+
"bos_token_id": 0,
|
| 10 |
+
"dtype": "float32",
|
| 11 |
+
"embd_pdrop": 0.1,
|
| 12 |
+
"eos_token_id": 0,
|
| 13 |
+
"inference_runner": 0,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"layer_norm_epsilon": 1e-05,
|
| 16 |
+
"max_batch_size": null,
|
| 17 |
+
"max_sequence_length": null,
|
| 18 |
+
"model_type": "gpt_bigcode",
|
| 19 |
+
"multi_query": true,
|
| 20 |
+
"n_embd": 768,
|
| 21 |
+
"n_head": 12,
|
| 22 |
+
"n_inner": 3072,
|
| 23 |
+
"n_layer": 20,
|
| 24 |
+
"n_positions": 8192,
|
| 25 |
+
"num_key_value_heads": 1,
|
| 26 |
+
"pad_key_length": true,
|
| 27 |
+
"pad_token_id": null,
|
| 28 |
+
"pre_allocate_kv_cache": false,
|
| 29 |
+
"resid_pdrop": 0.1,
|
| 30 |
+
"scale_attention_softmax_in_fp32": true,
|
| 31 |
+
"scale_attn_weights": true,
|
| 32 |
+
"summary_activation": null,
|
| 33 |
+
"summary_first_dropout": 0.1,
|
| 34 |
+
"summary_proj_to_labels": true,
|
| 35 |
+
"summary_type": "cls_index",
|
| 36 |
+
"summary_use_proj": true,
|
| 37 |
+
"tie_word_embeddings": true,
|
| 38 |
+
"transformers_version": "5.20.2",
|
| 39 |
+
"use_cache": false,
|
| 40 |
+
"validate_runner_input": true,
|
| 41 |
+
"vocab_size": 49152
|
| 42 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"transformers_version": "5.20.2"
|
| 6 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6365d7088a2977c9f6f5c8c8305012c8e4aab1dbd71b61bb79e1154760f4b37
|
| 3 |
+
size 656601304
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|endoftext|>",
|
| 8 |
+
"<fim_prefix>",
|
| 9 |
+
"<fim_middle>",
|
| 10 |
+
"<fim_suffix>",
|
| 11 |
+
"<fim_pad>",
|
| 12 |
+
"<filename>",
|
| 13 |
+
"<gh_stars>",
|
| 14 |
+
"<issue_start>",
|
| 15 |
+
"<issue_comment>",
|
| 16 |
+
"<issue_closed>",
|
| 17 |
+
"<jupyter_start>",
|
| 18 |
+
"<jupyter_text>",
|
| 19 |
+
"<jupyter_code>",
|
| 20 |
+
"<jupyter_output>",
|
| 21 |
+
"<empty_output>",
|
| 22 |
+
"<commit_before>",
|
| 23 |
+
"<commit_msg>",
|
| 24 |
+
"<commit_after>",
|
| 25 |
+
"<reponame>"
|
| 26 |
+
],
|
| 27 |
+
"is_local": false,
|
| 28 |
+
"local_files_only": false,
|
| 29 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 30 |
+
"tokenizer_class": "TokenizersBackend",
|
| 31 |
+
"unk_token": "<|endoftext|>",
|
| 32 |
+
"vocab_size": 49152
|
| 33 |
+
}
|