K00B404 commited on
Commit
d7ded46
·
verified ·
1 Parent(s): 450eace

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. README.md +77 -0
  2. config.json +29 -0
  3. mergekit_config.yml +25 -0
  4. model.safetensors +3 -0
  5. tokenizer.json +0 -0
  6. tokenizer_config.json +35 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - Qwen/Qwen2.5-Coder-1.5B-Instruct
4
+ - Qwen/Qwen2.5-Math-1.5B-Instruct
5
+ - Qwen/Qwen2.5-1.5B
6
+ - agentica-org/DeepScaleR-1.5B-Preview
7
+ tags:
8
+ - merge
9
+ - mergekit
10
+ - lazymergekit
11
+ - Qwen/Qwen2.5-Coder-1.5B-Instruct
12
+ - Qwen/Qwen2.5-Math-1.5B-Instruct
13
+ - Qwen/Qwen2.5-1.5B
14
+ - agentica-org/DeepScaleR-1.5B-Preview
15
+ ---
16
+
17
+ # DeepQwenScalerPlus
18
+
19
+ DeepQwenScalerPlus is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
20
+ * [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct)
21
+ * [Qwen/Qwen2.5-Math-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Math-1.5B-Instruct)
22
+ * [Qwen/Qwen2.5-1.5B](https://huggingface.co/Qwen/Qwen2.5-1.5B)
23
+ * [agentica-org/DeepScaleR-1.5B-Preview](https://huggingface.co/agentica-org/DeepScaleR-1.5B-Preview)
24
+
25
+ ## 🧩 Configuration
26
+
27
+ ```yaml
28
+ models:
29
+ - model: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
30
+ # no parameters necessary for base model
31
+ - model: Qwen/Qwen2.5-Coder-1.5B-Instruct
32
+ parameters:
33
+ density: 0.5
34
+ weight: 0.5
35
+ - model: Qwen/Qwen2.5-Math-1.5B-Instruct
36
+ parameters:
37
+ density: 0.6
38
+ weight: 0.5
39
+ - model: Qwen/Qwen2.5-1.5B
40
+ parameters:
41
+ density: 0.6
42
+ weight: 0.5
43
+ - model: agentica-org/DeepScaleR-1.5B-Preview
44
+ parameters:
45
+ density: 0.4
46
+ weight: 0.6
47
+ merge_method: ties
48
+ base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
49
+ parameters:
50
+ normalize: true
51
+ dtype: float16
52
+ ```
53
+
54
+ ## 💻 Usage
55
+
56
+ ```python
57
+ !pip install -qU transformers accelerate
58
+
59
+ from transformers import AutoTokenizer
60
+ import transformers
61
+ import torch
62
+
63
+ model = "K00B404/DeepQwenScalerPlus"
64
+ messages = [{"role": "user", "content": "What is a large language model?"}]
65
+
66
+ tokenizer = AutoTokenizer.from_pretrained(model)
67
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
68
+ pipeline = transformers.pipeline(
69
+ "text-generation",
70
+ model=model,
71
+ torch_dtype=torch.float16,
72
+ device_map="auto",
73
+ )
74
+
75
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
76
+ print(outputs[0]["generated_text"])
77
+ ```
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151643,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 1536,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 8960,
12
+ "max_position_embeddings": 131072,
13
+ "max_window_layers": 21,
14
+ "model_type": "qwen2",
15
+ "num_attention_heads": 12,
16
+ "num_hidden_layers": 28,
17
+ "num_key_value_heads": 2,
18
+ "rms_norm_eps": 1e-06,
19
+ "rope_scaling": null,
20
+ "rope_theta": 10000,
21
+ "sliding_window": 4096,
22
+ "tie_word_embeddings": false,
23
+ "torch_dtype": "float16",
24
+ "transformers_version": "4.50.0",
25
+ "use_cache": true,
26
+ "use_mrope": false,
27
+ "use_sliding_window": false,
28
+ "vocab_size": 151936
29
+ }
mergekit_config.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ models:
3
+ - model: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
4
+ # no parameters necessary for base model
5
+ - model: Qwen/Qwen2.5-Coder-1.5B-Instruct
6
+ parameters:
7
+ density: 0.5
8
+ weight: 0.5
9
+ - model: Qwen/Qwen2.5-Math-1.5B-Instruct
10
+ parameters:
11
+ density: 0.6
12
+ weight: 0.5
13
+ - model: Qwen/Qwen2.5-1.5B
14
+ parameters:
15
+ density: 0.6
16
+ weight: 0.5
17
+ - model: agentica-org/DeepScaleR-1.5B-Preview
18
+ parameters:
19
+ density: 0.4
20
+ weight: 0.6
21
+ merge_method: ties
22
+ base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
23
+ parameters:
24
+ normalize: true
25
+ dtype: float16
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95621081a5c09c5c979ed38a60c9404bd4fbb102bd80c5aae1051ace63a0ee38
3
+ size 3554214416
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "bos_token": {
5
+ "__type": "AddedToken",
6
+ "content": "<|begin▁of▁sentence|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "clean_up_tokenization_spaces": false,
13
+ "eos_token": {
14
+ "__type": "AddedToken",
15
+ "content": "<|end▁of▁sentence|>",
16
+ "lstrip": false,
17
+ "normalized": true,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "legacy": true,
22
+ "model_max_length": 16384,
23
+ "pad_token": {
24
+ "__type": "AddedToken",
25
+ "content": "<|end▁of▁sentence|>",
26
+ "lstrip": false,
27
+ "normalized": true,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ },
31
+ "sp_model_kwargs": {},
32
+ "unk_token": null,
33
+ "tokenizer_class": "LlamaTokenizerFast",
34
+ "chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}"
35
+ }