Kuantum-ai1 commited on
Commit
ed55319
·
verified ·
1 Parent(s): 5efb165

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bigcode-openrail-m
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ base_model: Kuantum-ai1/TinyCode1.1-164M-Python
8
+ tags:
9
+ - code
10
+ - python
11
+ ---
12
+
13
+ # TinyCode1.2-164M-Python
14
+
15
+ 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.
16
+
17
+ ## Training
18
+
19
+ - Base model: `Kuantum-ai1/TinyCode1.1-164M-Python` (v1.1)
20
+ - 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).
21
+ - 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.
22
+ - Hardware: 2x NVIDIA T4 (DDP, fp16 mixed precision), sequence length 1024, batch 65k tokens, peak LR 4e-05, cosine schedule
23
+
24
+ ## Evaluation
25
+
26
+ Greedy decoding, pass@1 (%), identical harness for every model (max 200 new tokens, 10 s timeout per program).
27
+ 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.
28
+
29
+ | Model | Params | HumanEval | MBPP |
30
+ |---|---|---|---|
31
+ | Base: bigcode/tiny_starcoder_py | 164M | 9.15 | 4.8 |
32
+ | Kuantum-ai1/TinyCode1-164M-Python (v1) | 164M | 9.15 | 4.0 |
33
+ | Kuantum-ai1/TinyCode1.2-164M-Python (v1.2, ours) | 164M | 0.0 | 8.8 |
34
+ | Kuantum-ai1/TinyCode1.1-164M-Python (v1.1) | 164M | 0.0 | 9.8 |
35
+
36
+ Compared with v1.1: HumanEval +0.00, MBPP -1.00 (absolute pass@1 points).
37
+
38
+ 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.
39
+
40
+ ## GGUF
41
+
42
+ Not available.
43
+
44
+ ## Usage
45
+
46
+ ```python
47
+ from transformers import AutoModelForCausalLM, AutoTokenizer
48
+ tok = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1.2-164M-Python")
49
+ model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1.2-164M-Python")
50
+ ids = tok("def fibonacci(n):", return_tensors="pt")
51
+ print(tok.decode(model.generate(**ids, max_new_tokens=100)[0]))
52
+ ```
53
+
54
+ ## Limitations
55
+
56
+ Small model: it makes frequent mistakes and should not be relied on for production code. Generated code must be reviewed before use.
57
+
58
+ ## License
59
+
60
+ bigcode-openrail-m
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:f5f33d541fb559c427e6c6e1072c5af3fff74fb29240c40513c3fedcd54ad2e8
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
+ }