Duplicate from TheBloke/deepseek-coder-33B-instruct-GPTQ
Browse filesCo-authored-by: Tom Jobbins <[email protected]>
- .gitattributes +35 -0
- LICENSE +91 -0
- README.md +432 -0
- config.json +42 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- quantize_config.json +10 -0
- tokenizer.json +0 -0
- tokenizer_config.json +35 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz 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
|
LICENSE
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DEEPSEEK LICENSE AGREEMENT
|
2 |
+
|
3 |
+
Version 1.0, 23 October 2023
|
4 |
+
|
5 |
+
Copyright (c) 2023 DeepSeek
|
6 |
+
|
7 |
+
Section I: PREAMBLE
|
8 |
+
|
9 |
+
Large generative models are being widely adopted and used, and have the potential to transform the way individuals conceive and benefit from AI or ML technologies.
|
10 |
+
|
11 |
+
Notwithstanding the current and potential benefits that these artifacts can bring to society at large, there are also concerns about potential misuses of them, either due to their technical limitations or ethical considerations.
|
12 |
+
|
13 |
+
In short, this license strives for both the open and responsible downstream use of the accompanying model. When it comes to the open character, we took inspiration from open source permissive licenses regarding the grant of IP rights. Referring to the downstream responsible use, we added use-based restrictions not permitting the use of the model in very specific scenarios, in order for the licensor to be able to enforce the license in case potential misuses of the Model may occur. At the same time, we strive to promote open and responsible research on generative models for content generation.
|
14 |
+
|
15 |
+
Even though downstream derivative versions of the model could be released under different licensing terms, the latter will always have to include - at minimum - the same use-based restrictions as the ones in the original license (this license). We believe in the intersection between open and responsible AI development; thus, this agreement aims to strike a balance between both in order to enable responsible open-science in the field of AI.
|
16 |
+
|
17 |
+
This License governs the use of the model (and its derivatives) and is informed by the model card associated with the model.
|
18 |
+
|
19 |
+
NOW THEREFORE, You and DeepSeek agree as follows:
|
20 |
+
|
21 |
+
1. Definitions
|
22 |
+
"License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.
|
23 |
+
"Data" means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.
|
24 |
+
"Output" means the results of operating a Model as embodied in informational content resulting therefrom.
|
25 |
+
"Model" means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.
|
26 |
+
"Derivatives of the Model" means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.
|
27 |
+
"Complementary Material" means the accompanying source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, etc, if any.
|
28 |
+
"Distribution" means any transmission, reproduction, publication or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means - e.g. API-based or web access.
|
29 |
+
"DeepSeek" (or "we") means Beijing DeepSeek Artificial Intelligence Fundamental Technology Research Co., Ltd., Hangzhou DeepSeek Artificial Intelligence Fundamental Technology Research Co., Ltd. and/or any of their affiliates.
|
30 |
+
"You" (or "Your") means an individual or Legal Entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application - e.g. chatbot, translator, etc.
|
31 |
+
"Third Parties" means individuals or legal entities that are not under common control with DeepSeek or You.
|
32 |
+
|
33 |
+
Section II: INTELLECTUAL PROPERTY RIGHTS
|
34 |
+
|
35 |
+
Both copyright and patent grants apply to the Model, Derivatives of the Model and Complementary Material. The Model and Derivatives of the Model are subject to additional terms as described in Section III.
|
36 |
+
|
37 |
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, DeepSeek hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model.
|
38 |
+
|
39 |
+
3. Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, DeepSeek hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by DeepSeek that are necessarily infringed by its contribution(s). If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or works shall terminate as of the date such litigation is asserted or filed.
|
40 |
+
|
41 |
+
|
42 |
+
Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION
|
43 |
+
|
44 |
+
4. Distribution and Redistribution. You may host for Third Party remote access purposes (e.g. software-as-a-service), reproduce and distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the following conditions:
|
45 |
+
a. Use-based restrictions as referenced in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (e.g. a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model or Derivatives of the Model are subject to paragraph 5. This provision does not apply to the use of Complementary Material.
|
46 |
+
b. You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License;
|
47 |
+
c. You must cause any modified files to carry prominent notices stating that You changed the files;
|
48 |
+
d. You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model, Derivatives of the Model.
|
49 |
+
e. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions - respecting paragraph 4.a. – for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License.
|
50 |
+
|
51 |
+
5. Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Therefore You cannot use the Model and the Derivatives of the Model for the specified restricted uses. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, finetuning, updating, running, training, evaluating and/or reparametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph (paragraph 5).
|
52 |
+
|
53 |
+
6. The Output You Generate. Except as set forth herein, DeepSeek claims no rights in the Output You generate using the Model. You are accountable for the Output you generate and its subsequent uses. No use of the output can contravene any provision as stated in the License.
|
54 |
+
|
55 |
+
Section IV: OTHER PROVISIONS
|
56 |
+
|
57 |
+
7. Updates and Runtime Restrictions. To the maximum extent permitted by law, DeepSeek reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License.
|
58 |
+
|
59 |
+
8. Trademarks and related. Nothing in this License permits You to make use of DeepSeek’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by DeepSeek.
|
60 |
+
|
61 |
+
9. Personal information, IP rights and related. This Model may contain personal information and works with IP rights. You commit to complying with applicable laws and regulations in the handling of personal information and the use of such works. Please note that DeepSeek's license granted to you to use the Model does not imply that you have obtained a legitimate basis for processing the related information or works. As an independent personal information processor and IP rights user, you need to ensure full compliance with relevant legal and regulatory requirements when handling personal information and works with IP rights that may be contained in the Model, and are willing to assume solely any risks and consequences that may arise from that.
|
62 |
+
|
63 |
+
10. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, DeepSeek provides the Model and the Complementary Material on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model, Derivatives of the Model, and the Complementary Material and assume any risks associated with Your exercise of permissions under this License.
|
64 |
+
|
65 |
+
11. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall DeepSeek be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model and the Complementary Material (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if DeepSeek has been advised of the possibility of such damages.
|
66 |
+
|
67 |
+
12. Accepting Warranty or Additional Liability. While redistributing the Model, Derivatives of the Model and the Complementary Material thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of DeepSeek, and only if You agree to indemnify, defend, and hold DeepSeek harmless for any liability incurred by, or claims asserted against, DeepSeek by reason of your accepting any such warranty or additional liability.
|
68 |
+
|
69 |
+
13. If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.
|
70 |
+
|
71 |
+
14. Governing Law and Jurisdiction. This agreement will be governed and construed under PRC laws without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this agreement. The courts located in the domicile of Hangzhou DeepSeek Artificial Intelligence Fundamental Technology Research Co., Ltd. shall have exclusive jurisdiction of any dispute arising out of this agreement.
|
72 |
+
|
73 |
+
END OF TERMS AND CONDITIONS
|
74 |
+
|
75 |
+
Attachment A
|
76 |
+
|
77 |
+
Use Restrictions
|
78 |
+
|
79 |
+
You agree not to use the Model or Derivatives of the Model:
|
80 |
+
|
81 |
+
- In any way that violates any applicable national or international law or regulation or infringes upon the lawful rights and interests of any third party;
|
82 |
+
- For military use in any way;
|
83 |
+
- For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
|
84 |
+
- To generate or disseminate verifiably false information and/or content with the purpose of harming others;
|
85 |
+
- To generate or disseminate inappropriate content subject to applicable regulatory requirements;
|
86 |
+
- To generate or disseminate personal identifiable information without due authorization or for unreasonable use;
|
87 |
+
- To defame, disparage or otherwise harass others;
|
88 |
+
- For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
|
89 |
+
- For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;
|
90 |
+
- To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;
|
91 |
+
- For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories.
|
README.md
ADDED
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: deepseek-ai/deepseek-coder-33b-instruct
|
3 |
+
inference: false
|
4 |
+
license: other
|
5 |
+
license_link: LICENSE
|
6 |
+
license_name: deepseek
|
7 |
+
model_creator: DeepSeek
|
8 |
+
model_name: Deepseek Coder 33B Instruct
|
9 |
+
model_type: deepseek
|
10 |
+
prompt_template: 'You are an AI programming assistant, utilizing the Deepseek Coder
|
11 |
+
model, developed by Deepseek Company, and you only answer questions related to computer
|
12 |
+
science. For politically sensitive questions, security and privacy issues, and other
|
13 |
+
non-computer science questions, you will refuse to answer.
|
14 |
+
|
15 |
+
### Instruction:
|
16 |
+
|
17 |
+
{prompt}
|
18 |
+
|
19 |
+
### Response:
|
20 |
+
|
21 |
+
'
|
22 |
+
quantized_by: TheBloke
|
23 |
+
---
|
24 |
+
<!-- markdownlint-disable MD041 -->
|
25 |
+
|
26 |
+
<!-- header start -->
|
27 |
+
<!-- 200823 -->
|
28 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
29 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
30 |
+
</div>
|
31 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
32 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
33 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
34 |
+
</div>
|
35 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
36 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
<div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
|
40 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
41 |
+
<!-- header end -->
|
42 |
+
|
43 |
+
# Deepseek Coder 33B Instruct - GPTQ
|
44 |
+
- Model creator: [DeepSeek](https://huggingface.co/deepseek-ai)
|
45 |
+
- Original model: [Deepseek Coder 33B Instruct](https://huggingface.co/deepseek-ai/deepseek-coder-33b-instruct)
|
46 |
+
|
47 |
+
<!-- description start -->
|
48 |
+
## Description
|
49 |
+
|
50 |
+
This repo contains GPTQ model files for [DeepSeek's Deepseek Coder 33B Instruct](https://huggingface.co/deepseek-ai/deepseek-coder-33b-instruct).
|
51 |
+
|
52 |
+
Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
|
53 |
+
|
54 |
+
These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
|
55 |
+
|
56 |
+
<!-- description end -->
|
57 |
+
<!-- repositories-available start -->
|
58 |
+
## Repositories available
|
59 |
+
|
60 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-AWQ)
|
61 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ)
|
62 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GGUF)
|
63 |
+
* [DeepSeek's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/deepseek-ai/deepseek-coder-33b-instruct)
|
64 |
+
<!-- repositories-available end -->
|
65 |
+
|
66 |
+
<!-- prompt-template start -->
|
67 |
+
## Prompt template: DeepSeek
|
68 |
+
|
69 |
+
```
|
70 |
+
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.
|
71 |
+
### Instruction:
|
72 |
+
{prompt}
|
73 |
+
### Response:
|
74 |
+
|
75 |
+
```
|
76 |
+
|
77 |
+
<!-- prompt-template end -->
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
<!-- README_GPTQ.md-compatible clients start -->
|
82 |
+
## Known compatible clients / servers
|
83 |
+
|
84 |
+
These GPTQ models are known to work in the following inference servers/webuis.
|
85 |
+
|
86 |
+
- [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
87 |
+
- [KoboldAI United](https://github.com/henk717/koboldai)
|
88 |
+
- [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
|
89 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
90 |
+
|
91 |
+
This may not be a complete list; if you know of others, please let me know!
|
92 |
+
<!-- README_GPTQ.md-compatible clients end -->
|
93 |
+
|
94 |
+
<!-- README_GPTQ.md-provided-files start -->
|
95 |
+
## Provided files, and GPTQ parameters
|
96 |
+
|
97 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
98 |
+
|
99 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
100 |
+
|
101 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
102 |
+
|
103 |
+
<details>
|
104 |
+
<summary>Explanation of GPTQ parameters</summary>
|
105 |
+
|
106 |
+
- Bits: The bit size of the quantised model.
|
107 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
108 |
+
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
|
109 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
110 |
+
- GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
|
111 |
+
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
|
112 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
|
113 |
+
|
114 |
+
</details>
|
115 |
+
|
116 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
117 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
118 |
+
| [main](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 17.40 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
|
119 |
+
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 18.03 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
120 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 19.96 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
121 |
+
| [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 13.89 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
|
122 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 33.84 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
123 |
+
| [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 15.72 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
|
124 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 34.60 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
125 |
+
|
126 |
+
<!-- README_GPTQ.md-provided-files end -->
|
127 |
+
|
128 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
129 |
+
## How to download, including from branches
|
130 |
+
|
131 |
+
### In text-generation-webui
|
132 |
+
|
133 |
+
To download from the `main` branch, enter `TheBloke/deepseek-coder-33B-instruct-GPTQ` in the "Download model" box.
|
134 |
+
|
135 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/deepseek-coder-33B-instruct-GPTQ:gptq-4bit-128g-actorder_True`
|
136 |
+
|
137 |
+
### From the command line
|
138 |
+
|
139 |
+
I recommend using the `huggingface-hub` Python library:
|
140 |
+
|
141 |
+
```shell
|
142 |
+
pip3 install huggingface-hub
|
143 |
+
```
|
144 |
+
|
145 |
+
To download the `main` branch to a folder called `deepseek-coder-33B-instruct-GPTQ`:
|
146 |
+
|
147 |
+
```shell
|
148 |
+
mkdir deepseek-coder-33B-instruct-GPTQ
|
149 |
+
huggingface-cli download TheBloke/deepseek-coder-33B-instruct-GPTQ --local-dir deepseek-coder-33B-instruct-GPTQ --local-dir-use-symlinks False
|
150 |
+
```
|
151 |
+
|
152 |
+
To download from a different branch, add the `--revision` parameter:
|
153 |
+
|
154 |
+
```shell
|
155 |
+
mkdir deepseek-coder-33B-instruct-GPTQ
|
156 |
+
huggingface-cli download TheBloke/deepseek-coder-33B-instruct-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir deepseek-coder-33B-instruct-GPTQ --local-dir-use-symlinks False
|
157 |
+
```
|
158 |
+
|
159 |
+
<details>
|
160 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
161 |
+
|
162 |
+
If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
|
163 |
+
|
164 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
165 |
+
|
166 |
+
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
|
167 |
+
|
168 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
169 |
+
|
170 |
+
```shell
|
171 |
+
pip3 install hf_transfer
|
172 |
+
```
|
173 |
+
|
174 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
175 |
+
|
176 |
+
```shell
|
177 |
+
mkdir deepseek-coder-33B-instruct-GPTQ
|
178 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/deepseek-coder-33B-instruct-GPTQ --local-dir deepseek-coder-33B-instruct-GPTQ --local-dir-use-symlinks False
|
179 |
+
```
|
180 |
+
|
181 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
182 |
+
</details>
|
183 |
+
|
184 |
+
### With `git` (**not** recommended)
|
185 |
+
|
186 |
+
To clone a specific branch with `git`, use a command like this:
|
187 |
+
|
188 |
+
```shell
|
189 |
+
git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/deepseek-coder-33B-instruct-GPTQ
|
190 |
+
```
|
191 |
+
|
192 |
+
Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
|
193 |
+
|
194 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
195 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
196 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
197 |
+
|
198 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
199 |
+
|
200 |
+
It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
|
201 |
+
|
202 |
+
1. Click the **Model tab**.
|
203 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/deepseek-coder-33B-instruct-GPTQ`.
|
204 |
+
|
205 |
+
- To download from a specific branch, enter for example `TheBloke/deepseek-coder-33B-instruct-GPTQ:gptq-4bit-128g-actorder_True`
|
206 |
+
- see Provided Files above for the list of branches for each option.
|
207 |
+
|
208 |
+
3. Click **Download**.
|
209 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
210 |
+
5. In the top left, click the refresh icon next to **Model**.
|
211 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `deepseek-coder-33B-instruct-GPTQ`
|
212 |
+
7. The model will automatically load, and is now ready for use!
|
213 |
+
8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
|
214 |
+
|
215 |
+
- Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
|
216 |
+
|
217 |
+
9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
|
218 |
+
|
219 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
220 |
+
|
221 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
222 |
+
## Serving this model from Text Generation Inference (TGI)
|
223 |
+
|
224 |
+
It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
|
225 |
+
|
226 |
+
Example Docker parameters:
|
227 |
+
|
228 |
+
```shell
|
229 |
+
--model-id TheBloke/deepseek-coder-33B-instruct-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
230 |
+
```
|
231 |
+
|
232 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
233 |
+
|
234 |
+
```shell
|
235 |
+
pip3 install huggingface-hub
|
236 |
+
```
|
237 |
+
|
238 |
+
```python
|
239 |
+
from huggingface_hub import InferenceClient
|
240 |
+
|
241 |
+
endpoint_url = "https://your-endpoint-url-here"
|
242 |
+
|
243 |
+
prompt = "Tell me about AI"
|
244 |
+
prompt_template=f'''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.
|
245 |
+
### Instruction:
|
246 |
+
{prompt}
|
247 |
+
### Response:
|
248 |
+
'''
|
249 |
+
|
250 |
+
client = InferenceClient(endpoint_url)
|
251 |
+
response = client.text_generation(prompt,
|
252 |
+
max_new_tokens=128,
|
253 |
+
do_sample=True,
|
254 |
+
temperature=0.7,
|
255 |
+
top_p=0.95,
|
256 |
+
top_k=40,
|
257 |
+
repetition_penalty=1.1)
|
258 |
+
|
259 |
+
print(f"Model output: {response}")
|
260 |
+
```
|
261 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
262 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
263 |
+
## How to use this GPTQ model from Python code
|
264 |
+
|
265 |
+
### Install the necessary packages
|
266 |
+
|
267 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
268 |
+
|
269 |
+
```shell
|
270 |
+
pip3 install transformers optimum
|
271 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
272 |
+
```
|
273 |
+
|
274 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
275 |
+
|
276 |
+
```shell
|
277 |
+
pip3 uninstall -y auto-gptq
|
278 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
279 |
+
cd AutoGPTQ
|
280 |
+
git checkout v0.4.2
|
281 |
+
pip3 install .
|
282 |
+
```
|
283 |
+
|
284 |
+
### You can then use the following code
|
285 |
+
|
286 |
+
```python
|
287 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
288 |
+
|
289 |
+
model_name_or_path = "TheBloke/deepseek-coder-33B-instruct-GPTQ"
|
290 |
+
# To use a different branch, change revision
|
291 |
+
# For example: revision="gptq-4bit-128g-actorder_True"
|
292 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
293 |
+
device_map="auto",
|
294 |
+
trust_remote_code=False,
|
295 |
+
revision="main")
|
296 |
+
|
297 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
298 |
+
|
299 |
+
prompt = "Tell me about AI"
|
300 |
+
prompt_template=f'''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.
|
301 |
+
### Instruction:
|
302 |
+
{prompt}
|
303 |
+
### Response:
|
304 |
+
'''
|
305 |
+
|
306 |
+
print("\n\n*** Generate:")
|
307 |
+
|
308 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
309 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
310 |
+
print(tokenizer.decode(output[0]))
|
311 |
+
|
312 |
+
# Inference can also be done using transformers' pipeline
|
313 |
+
|
314 |
+
print("*** Pipeline:")
|
315 |
+
pipe = pipeline(
|
316 |
+
"text-generation",
|
317 |
+
model=model,
|
318 |
+
tokenizer=tokenizer,
|
319 |
+
max_new_tokens=512,
|
320 |
+
do_sample=True,
|
321 |
+
temperature=0.7,
|
322 |
+
top_p=0.95,
|
323 |
+
top_k=40,
|
324 |
+
repetition_penalty=1.1
|
325 |
+
)
|
326 |
+
|
327 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
328 |
+
```
|
329 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
330 |
+
|
331 |
+
<!-- README_GPTQ.md-compatibility start -->
|
332 |
+
## Compatibility
|
333 |
+
|
334 |
+
The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
|
335 |
+
|
336 |
+
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
|
337 |
+
|
338 |
+
For a list of clients/servers, please see "Known compatible clients / servers", above.
|
339 |
+
<!-- README_GPTQ.md-compatibility end -->
|
340 |
+
|
341 |
+
<!-- footer start -->
|
342 |
+
<!-- 200823 -->
|
343 |
+
## Discord
|
344 |
+
|
345 |
+
For further support, and discussions on these models and AI in general, join us at:
|
346 |
+
|
347 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
348 |
+
|
349 |
+
## Thanks, and how to contribute
|
350 |
+
|
351 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
352 |
+
|
353 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
354 |
+
|
355 |
+
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
|
356 |
+
|
357 |
+
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
|
358 |
+
|
359 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
360 |
+
|
361 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
362 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
363 |
+
|
364 |
+
**Special thanks to**: Aemon Algiz.
|
365 |
+
|
366 |
+
**Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
|
367 |
+
|
368 |
+
|
369 |
+
Thank you to all my generous patrons and donaters!
|
370 |
+
|
371 |
+
And thank you again to a16z for their generous grant.
|
372 |
+
|
373 |
+
<!-- footer end -->
|
374 |
+
|
375 |
+
# Original model card: DeepSeek's Deepseek Coder 33B Instruct
|
376 |
+
|
377 |
+
|
378 |
+
|
379 |
+
<p align="center">
|
380 |
+
<img width="1000px" alt="DeepSeek Coder" src="https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/pictures/logo.png?raw=true">
|
381 |
+
</p>
|
382 |
+
<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>
|
383 |
+
<hr>
|
384 |
+
|
385 |
+
|
386 |
+
|
387 |
+
### 1. Introduction of Deepseek Coder
|
388 |
+
|
389 |
+
Deepseek Coder is composed of a series of code language models, each trained from scratch on 2T tokens, with a composition of 87% code and 13% natural language in both English and Chinese. We provide various sizes of the code model, ranging from 1B to 33B versions. Each model is pre-trained on project-level code corpus by employing a window size of 16K and a extra fill-in-the-blank task, to support project-level code completion and infilling. For coding capabilities, Deepseek Coder achieves state-of-the-art performance among open-source code models on multiple programming languages and various benchmarks.
|
390 |
+
|
391 |
+
- **Massive Training Data**: Trained from scratch on 2T tokens, including 87% code and 13% linguistic data in both English and Chinese languages.
|
392 |
+
|
393 |
+
- **Highly Flexible & Scalable**: Offered in model sizes of 1.3B, 5.7B, 6.7B, and 33B, enabling users to choose the setup most suitable for their requirements.
|
394 |
+
|
395 |
+
- **Superior Model Performance**: State-of-the-art performance among publicly available code models on HumanEval, MultiPL-E, MBPP, DS-1000, and APPS benchmarks.
|
396 |
+
|
397 |
+
- **Advanced Code Completion Capabilities**: A window size of 16K and a fill-in-the-blank task, supporting project-level code completion and infilling tasks.
|
398 |
+
|
399 |
+
|
400 |
+
|
401 |
+
### 2. Model Summary
|
402 |
+
deepseek-coder-33b-instruct is a 33B parameter model initialized from deepseek-coder-33b-base and fine-tuned on 2B tokens of instruction data.
|
403 |
+
- **Home Page:** [DeepSeek](https://deepseek.com/)
|
404 |
+
- **Repository:** [deepseek-ai/deepseek-coder](https://github.com/deepseek-ai/deepseek-coder)
|
405 |
+
- **Chat With DeepSeek Coder:** [DeepSeek-Coder](https://coder.deepseek.com/)
|
406 |
+
|
407 |
+
|
408 |
+
### 3. How to Use
|
409 |
+
Here give some examples of how to use our model.
|
410 |
+
#### Chat Model Inference
|
411 |
+
```python
|
412 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
413 |
+
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-33b-instruct", trust_remote_code=True)
|
414 |
+
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-33b-instruct", trust_remote_code=True).cuda()
|
415 |
+
messages=[
|
416 |
+
{ 'role': 'user', 'content': "write a quick sort algorithm in python."}
|
417 |
+
]
|
418 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
|
419 |
+
# 32021 is the id of <|EOT|> token
|
420 |
+
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=32021)
|
421 |
+
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
|
422 |
+
```
|
423 |
+
|
424 |
+
### 4. License
|
425 |
+
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.
|
426 |
+
|
427 |
+
See the [LICENSE-MODEL](https://github.com/deepseek-ai/deepseek-coder/blob/main/LICENSE-MODEL) for more details.
|
428 |
+
|
429 |
+
### 5. Contact
|
430 |
+
|
431 |
+
If you have any questions, please raise an issue or contact us at [[email protected]](mailto:[email protected]).
|
432 |
+
|
config.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/workspace/process/deepseek-ai_deepseek-coder-33b-instruct/source",
|
3 |
+
"architectures": [
|
4 |
+
"LlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"bos_token_id": 32013,
|
8 |
+
"eos_token_id": 32021,
|
9 |
+
"hidden_act": "silu",
|
10 |
+
"hidden_size": 7168,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 19200,
|
13 |
+
"max_position_embeddings": 16384,
|
14 |
+
"model_type": "llama",
|
15 |
+
"num_attention_heads": 56,
|
16 |
+
"num_hidden_layers": 62,
|
17 |
+
"num_key_value_heads": 8,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"pretraining_tp": 1,
|
20 |
+
"rms_norm_eps": 1e-06,
|
21 |
+
"rope_scaling": {
|
22 |
+
"factor": 4.0,
|
23 |
+
"type": "linear"
|
24 |
+
},
|
25 |
+
"rope_theta": 100000,
|
26 |
+
"tie_word_embeddings": false,
|
27 |
+
"torch_dtype": "bfloat16",
|
28 |
+
"transformers_version": "4.35.0",
|
29 |
+
"use_cache": true,
|
30 |
+
"vocab_size": 32256,
|
31 |
+
"quantization_config": {
|
32 |
+
"bits": 4,
|
33 |
+
"group_size": -1,
|
34 |
+
"damp_percent": 0.1,
|
35 |
+
"desc_act": true,
|
36 |
+
"sym": true,
|
37 |
+
"true_sequential": true,
|
38 |
+
"model_name_or_path": null,
|
39 |
+
"model_file_base_name": "model",
|
40 |
+
"quant_method": "gptq"
|
41 |
+
}
|
42 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 32013,
|
4 |
+
"eos_token_id": 32014,
|
5 |
+
"transformers_version": "4.34.1"
|
6 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e00c3c6cab74a1d6fe9a267b47a75c58c6328a4b601700ad2243a27e77abc099
|
3 |
+
size 17399444712
|
quantize_config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bits": 4,
|
3 |
+
"group_size": -1,
|
4 |
+
"damp_percent": 0.1,
|
5 |
+
"desc_act": true,
|
6 |
+
"sym": true,
|
7 |
+
"true_sequential": true,
|
8 |
+
"model_name_or_path": null,
|
9 |
+
"model_file_base_name": "model"
|
10 |
+
}
|
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": 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": "{%- set found_item = false -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'system' -%}\n {%- set found_item = true -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if not found_item -%}\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{{'### Response:\\n'}}\n"
|
35 |
+
}
|