IvanHU commited on
Commit
3b7a128
·
verified ·
1 Parent(s): 02ecde4

Add files using upload-large-folder tool

Browse files
README.md CHANGED
@@ -1,3 +1,85 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: mlx
4
+ pipeline_tag: text-generation
5
+ language:
6
+ - en
7
+ - zh
8
+ tags:
9
+ - code
10
+ - math
11
+ - mlx
12
+ arxiv: 2412.17743
13
+ base_model: yulan-team/YuLan-Mini-Instruct
14
+ model-index:
15
+ - name: YuLan-Mini-Instruct
16
+ results:
17
+ - task:
18
+ type: text-generation
19
+ dataset:
20
+ name: HumanEval
21
+ type: openai_humaneval
22
+ metrics:
23
+ - type: pass@10
24
+ value: 0.866
25
+ name: pass@10
26
+ verified: false
27
+ - task:
28
+ type: text-generation
29
+ dataset:
30
+ name: MBPP
31
+ type: mbpp
32
+ metrics:
33
+ - type: pass@10
34
+ value: 0.857
35
+ name: pass@10
36
+ verified: false
37
+ - task:
38
+ type: text-generation
39
+ dataset:
40
+ name: MATH
41
+ type: math
42
+ metrics:
43
+ - type: maj@1
44
+ value: 0.552
45
+ name: maj@1
46
+ verified: false
47
+ - task:
48
+ type: text-generation
49
+ dataset:
50
+ name: GSM8K
51
+ type: gsm8k
52
+ metrics:
53
+ - type: maj@1
54
+ value: 0.717
55
+ name: maj@1
56
+ verified: false
57
+ ---
58
+
59
+ # IvanHU/YuLan-Mini-Instruct-4bit
60
+
61
+ This model [IvanHU/YuLan-Mini-Instruct-4bit](https://huggingface.co/IvanHU/YuLan-Mini-Instruct-4bit) was
62
+ converted to MLX format from [yulan-team/YuLan-Mini-Instruct](https://huggingface.co/yulan-team/YuLan-Mini-Instruct)
63
+ using mlx-lm version **0.22.2**.
64
+
65
+ ## Use with mlx
66
+
67
+ ```bash
68
+ pip install mlx-lm
69
+ ```
70
+
71
+ ```python
72
+ from mlx_lm import load, generate
73
+
74
+ model, tokenizer = load("IvanHU/YuLan-Mini-Instruct-4bit")
75
+
76
+ prompt = "hello"
77
+
78
+ if tokenizer.chat_template is not None:
79
+ messages = [{"role": "user", "content": prompt}]
80
+ prompt = tokenizer.apply_chat_template(
81
+ messages, add_generation_prompt=True
82
+ )
83
+
84
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
85
+ ```
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": true,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "head_dim": 64,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 1920,
12
+ "initializer_range": 5e-05,
13
+ "intermediate_size": 4800,
14
+ "max_position_embeddings": 28723,
15
+ "mlp_bias": false,
16
+ "model_type": "llama",
17
+ "num_attention_heads": 30,
18
+ "num_hidden_layers": 56,
19
+ "num_key_value_heads": 6,
20
+ "pad_token_id": 102,
21
+ "pretraining_tp": 1,
22
+ "quantization": {
23
+ "group_size": 64,
24
+ "bits": 4
25
+ },
26
+ "quantization_config": {
27
+ "group_size": 64,
28
+ "bits": 4
29
+ },
30
+ "rms_norm_eps": 1e-06,
31
+ "rope_scaling": null,
32
+ "rope_theta": 490000.0,
33
+ "tie_word_embeddings": false,
34
+ "torch_dtype": "bfloat16",
35
+ "transformers_version": "4.47.0",
36
+ "use_cache": false,
37
+ "vocab_size": 99000
38
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af305e758911190b10538469d3b962594d4c786385b91d965da1d5aec072e724
3
+ size 1364562335
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<pad>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ },
30
+ "102": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "103": {
39
+ "content": "<reasoning_step>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "104": {
47
+ "content": "<|start_header_id|>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "105": {
55
+ "content": "<|end_header_id|>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": true
61
+ },
62
+ "106": {
63
+ "content": "<|eot_id|>",
64
+ "lstrip": false,
65
+ "normalized": false,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": true
69
+ }
70
+ },
71
+ "bos_token": "<s>",
72
+ "chat_template": "{{- bos_token }}\n\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"You are YuLan-Mini, created by RUC AI Box. You are a helpful assistant.\" %}\n{%- endif %}\n\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n{%- for message in messages %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n'+ message['content'] | trim + '<|eot_id|>' }}\n{%- endfor %}\n\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}",
73
+ "clean_up_tokenization_spaces": false,
74
+ "eos_token": "</s>",
75
+ "extra_special_tokens": {},
76
+ "legacy": true,
77
+ "model_max_length": 1000000000000000019884624838656,
78
+ "pad_token": "<pad>",
79
+ "padding_side": "right",
80
+ "sp_model_kwargs": {},
81
+ "spaces_between_special_tokens": false,
82
+ "split_special_tokens": false,
83
+ "tokenizer_class": "LlamaTokenizerFast",
84
+ "unk_token": "<unk>",
85
+ "use_default_system_prompt": false
86
+ }