TechxGenus
commited on
Commit
•
f433581
1
Parent(s):
b2cd2fe
Upload folder using huggingface_hub
Browse files- LICENSE +0 -0
- README.md +57 -0
- config.json +100 -0
- generation_config.json +6 -0
- pytorch_model.bin +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +35 -0
LICENSE
ADDED
File without changes
|
README.md
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: deepseek
|
4 |
+
license_link: LICENSE
|
5 |
+
---
|
6 |
+
|
7 |
+
<p align="center">
|
8 |
+
<img width="1000px" alt="DeepSeek Coder" src="https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/pictures/logo.png?raw=true">
|
9 |
+
</p>
|
10 |
+
<p align="center"><a href="https://www.deepseek.com/">[🏠Homepage]</a> | <a href="https://coder.deepseek.com/">[🤖 Chat with DeepSeek Coder]</a> | <a href="https://discord.gg/Tc7c45Zzu5">[Discord]</a> | <a href="https://github.com/guoday/assert/blob/main/QR.png?raw=true">[Wechat(微信)]</a> </p>
|
11 |
+
<hr>
|
12 |
+
|
13 |
+
[AQLM](https://arxiv.org/abs/2401.06118) quantized version of deepseek-coder-7b-instruct-v1.5 model.
|
14 |
+
Refer to the [official GitHub repo](https://github.com/Vahe1994/AQLM) for more information.
|
15 |
+
|
16 |
+
---
|
17 |
+
|
18 |
+
### 1. Introduction of Deepseek-Coder-7B-Instruct v1.5
|
19 |
+
|
20 |
+
Deepseek-Coder-7B-Instruct-v1.5 is continue pre-trained from Deepseek-LLM 7B on 2T tokens by employing a window size of 4K and next token prediction objective, and then fine-tuned on 2B tokens of instruction data.
|
21 |
+
|
22 |
+
- **Home Page:** [DeepSeek](https://deepseek.com/)
|
23 |
+
- **Repository:** [deepseek-ai/deepseek-coder](https://github.com/deepseek-ai/deepseek-coder)
|
24 |
+
- **Chat With DeepSeek Coder:** [DeepSeek-Coder](https://coder.deepseek.com/)
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
### 2. Evaluation Results
|
29 |
+
<img width="1000px" alt="DeepSeek Coder" src="https://cdn-uploads.huggingface.co/production/uploads/6538815d1bdb3c40db94fbfa/xOtCTW5xdoLCKY4FR6tri.png">
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
### 3. How to Use
|
34 |
+
Here give some examples of how to use our model.
|
35 |
+
#### Chat Model Inference
|
36 |
+
```python
|
37 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-7b-instruct-v1.5", trust_remote_code=True)
|
39 |
+
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-7b-instruct-v1.5", trust_remote_code=True).cuda()
|
40 |
+
messages=[
|
41 |
+
{ 'role': 'user', 'content': "write a quick sort algorithm in python."}
|
42 |
+
]
|
43 |
+
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
44 |
+
|
45 |
+
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
|
46 |
+
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
|
47 |
+
```
|
48 |
+
|
49 |
+
### 4. License
|
50 |
+
This code repository is licensed under the MIT License. The use of DeepSeek Coder models is subject to the Model License. DeepSeek Coder supports commercial use.
|
51 |
+
|
52 |
+
See the [LICENSE-MODEL](https://github.com/deepseek-ai/deepseek-coder/blob/main/LICENSE-MODEL) for more details.
|
53 |
+
|
54 |
+
### 5. Contact
|
55 |
+
|
56 |
+
If you have any questions, please raise an issue or contact us at [service@deepseek.com](mailto:service@deepseek.com).
|
57 |
+
|
config.json
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"vocab_size": 102400,
|
3 |
+
"max_position_embeddings": 4096,
|
4 |
+
"hidden_size": 4096,
|
5 |
+
"intermediate_size": 11008,
|
6 |
+
"num_hidden_layers": 30,
|
7 |
+
"num_attention_heads": 32,
|
8 |
+
"num_key_value_heads": 32,
|
9 |
+
"hidden_act": "silu",
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"rms_norm_eps": 1e-06,
|
12 |
+
"pretraining_tp": 1,
|
13 |
+
"use_cache": true,
|
14 |
+
"rope_theta": 10000.0,
|
15 |
+
"rope_scaling": null,
|
16 |
+
"attention_bias": false,
|
17 |
+
"attention_dropout": 0.0,
|
18 |
+
"torch_dtype": "float16",
|
19 |
+
"tie_word_embeddings": false,
|
20 |
+
"architectures": [
|
21 |
+
"LlamaForCausalLM"
|
22 |
+
],
|
23 |
+
"bos_token_id": 100000,
|
24 |
+
"eos_token_id": 100015,
|
25 |
+
"_name_or_path": "deepseek-ai/deepseek-coder-7b-instruct-v1.5",
|
26 |
+
"transformers_version": "4.38.2",
|
27 |
+
"model_type": "llama",
|
28 |
+
"quantization_config": {
|
29 |
+
"quant_method": "aqlm",
|
30 |
+
"nbits_per_codebook": 16,
|
31 |
+
"num_codebooks": 1,
|
32 |
+
"out_group_size": 1,
|
33 |
+
"in_group_size": 8,
|
34 |
+
"linear_weights_not_to_quantize": [
|
35 |
+
"model.layers.0.input_layernorm.weight",
|
36 |
+
"model.layers.0.post_attention_layernorm.weight",
|
37 |
+
"model.layers.1.input_layernorm.weight",
|
38 |
+
"model.layers.1.post_attention_layernorm.weight",
|
39 |
+
"model.layers.2.input_layernorm.weight",
|
40 |
+
"model.layers.2.post_attention_layernorm.weight",
|
41 |
+
"model.layers.3.input_layernorm.weight",
|
42 |
+
"model.layers.3.post_attention_layernorm.weight",
|
43 |
+
"model.layers.4.input_layernorm.weight",
|
44 |
+
"model.layers.4.post_attention_layernorm.weight",
|
45 |
+
"model.layers.5.input_layernorm.weight",
|
46 |
+
"model.layers.5.post_attention_layernorm.weight",
|
47 |
+
"model.layers.6.input_layernorm.weight",
|
48 |
+
"model.layers.6.post_attention_layernorm.weight",
|
49 |
+
"model.layers.7.input_layernorm.weight",
|
50 |
+
"model.layers.7.post_attention_layernorm.weight",
|
51 |
+
"model.layers.8.input_layernorm.weight",
|
52 |
+
"model.layers.8.post_attention_layernorm.weight",
|
53 |
+
"model.layers.9.input_layernorm.weight",
|
54 |
+
"model.layers.9.post_attention_layernorm.weight",
|
55 |
+
"model.layers.10.input_layernorm.weight",
|
56 |
+
"model.layers.10.post_attention_layernorm.weight",
|
57 |
+
"model.layers.11.input_layernorm.weight",
|
58 |
+
"model.layers.11.post_attention_layernorm.weight",
|
59 |
+
"model.layers.12.input_layernorm.weight",
|
60 |
+
"model.layers.12.post_attention_layernorm.weight",
|
61 |
+
"model.layers.13.input_layernorm.weight",
|
62 |
+
"model.layers.13.post_attention_layernorm.weight",
|
63 |
+
"model.layers.14.input_layernorm.weight",
|
64 |
+
"model.layers.14.post_attention_layernorm.weight",
|
65 |
+
"model.layers.15.input_layernorm.weight",
|
66 |
+
"model.layers.15.post_attention_layernorm.weight",
|
67 |
+
"model.layers.16.input_layernorm.weight",
|
68 |
+
"model.layers.16.post_attention_layernorm.weight",
|
69 |
+
"model.layers.17.input_layernorm.weight",
|
70 |
+
"model.layers.17.post_attention_layernorm.weight",
|
71 |
+
"model.layers.18.input_layernorm.weight",
|
72 |
+
"model.layers.18.post_attention_layernorm.weight",
|
73 |
+
"model.layers.19.input_layernorm.weight",
|
74 |
+
"model.layers.19.post_attention_layernorm.weight",
|
75 |
+
"model.layers.20.input_layernorm.weight",
|
76 |
+
"model.layers.20.post_attention_layernorm.weight",
|
77 |
+
"model.layers.21.input_layernorm.weight",
|
78 |
+
"model.layers.21.post_attention_layernorm.weight",
|
79 |
+
"model.layers.22.input_layernorm.weight",
|
80 |
+
"model.layers.22.post_attention_layernorm.weight",
|
81 |
+
"model.layers.23.input_layernorm.weight",
|
82 |
+
"model.layers.23.post_attention_layernorm.weight",
|
83 |
+
"model.layers.24.input_layernorm.weight",
|
84 |
+
"model.layers.24.post_attention_layernorm.weight",
|
85 |
+
"model.layers.25.input_layernorm.weight",
|
86 |
+
"model.layers.25.post_attention_layernorm.weight",
|
87 |
+
"model.layers.26.input_layernorm.weight",
|
88 |
+
"model.layers.26.post_attention_layernorm.weight",
|
89 |
+
"model.layers.27.input_layernorm.weight",
|
90 |
+
"model.layers.27.post_attention_layernorm.weight",
|
91 |
+
"model.layers.28.input_layernorm.weight",
|
92 |
+
"model.layers.28.post_attention_layernorm.weight",
|
93 |
+
"model.layers.29.input_layernorm.weight",
|
94 |
+
"model.layers.29.post_attention_layernorm.weight",
|
95 |
+
"model.embed_tokens.weight",
|
96 |
+
"model.norm.weight",
|
97 |
+
"lm_head.weight"
|
98 |
+
]
|
99 |
+
}
|
100 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 100000,
|
4 |
+
"eos_token_id": 100015,
|
5 |
+
"transformers_version": "4.35.2"
|
6 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:097cf874701eb8df32d31bf13d1c9b0741eac9be8fd4ddce4cfda57c43c8ead2
|
3 |
+
size 3419025758
|
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": "<|EOT|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": true,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"legacy": true,
|
22 |
+
"model_max_length": 4096,
|
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 %}\n{% set add_generation_prompt = false %}\n{% endif %}\n{%- set ns = namespace(found=false) -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'system' -%}\n {%- set ns.found = true -%}\n {%- endif -%}\n{%- endfor -%}\n{{bos_token}}{%- if not ns.found -%}\n{{'You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer\\n'}}\n{%- endif %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' %}\n{{ message['content'] }}\n {%- else %}\n {%- if message['role'] == 'user' %}\n{{'### Instruction:\\n' + message['content'] + '\\n'}}\n {%- else %}\n{{'### Response:\\n' + message['content'] + '\\n<|EOT|>\\n'}}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{% if add_generation_prompt %}\n{{'### Response:'}}\n{% endif %}"
|
35 |
+
}
|