RichardErkhov
commited on
Commit
•
61a715c
1
Parent(s):
1711ef5
uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
deepseek-math-7b-rl - GGUF
|
11 |
+
- Model creator: https://huggingface.co/deepseek-ai/
|
12 |
+
- Original model: https://huggingface.co/deepseek-ai/deepseek-math-7b-rl/
|
13 |
+
|
14 |
+
|
15 |
+
| Name | Quant method | Size |
|
16 |
+
| ---- | ---- | ---- |
|
17 |
+
| [deepseek-math-7b-rl.Q2_K.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q2_K.gguf) | Q2_K | 2.53GB |
|
18 |
+
| [deepseek-math-7b-rl.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q3_K_S.gguf) | Q3_K_S | 2.92GB |
|
19 |
+
| [deepseek-math-7b-rl.Q3_K.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q3_K.gguf) | Q3_K | 3.22GB |
|
20 |
+
| [deepseek-math-7b-rl.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q3_K_M.gguf) | Q3_K_M | 3.22GB |
|
21 |
+
| [deepseek-math-7b-rl.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q3_K_L.gguf) | Q3_K_L | 3.49GB |
|
22 |
+
| [deepseek-math-7b-rl.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.IQ4_XS.gguf) | IQ4_XS | 3.56GB |
|
23 |
+
| [deepseek-math-7b-rl.Q4_0.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q4_0.gguf) | Q4_0 | 3.73GB |
|
24 |
+
| [deepseek-math-7b-rl.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.IQ4_NL.gguf) | IQ4_NL | 3.74GB |
|
25 |
+
| [deepseek-math-7b-rl.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q4_K_S.gguf) | Q4_K_S | 3.75GB |
|
26 |
+
| [deepseek-math-7b-rl.Q4_K.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q4_K.gguf) | Q4_K | 3.93GB |
|
27 |
+
| [deepseek-math-7b-rl.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q4_K_M.gguf) | Q4_K_M | 3.93GB |
|
28 |
+
| [deepseek-math-7b-rl.Q4_1.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q4_1.gguf) | Q4_1 | 4.1GB |
|
29 |
+
| [deepseek-math-7b-rl.Q5_0.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q5_0.gguf) | Q5_0 | 4.48GB |
|
30 |
+
| [deepseek-math-7b-rl.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q5_K_S.gguf) | Q5_K_S | 4.48GB |
|
31 |
+
| [deepseek-math-7b-rl.Q5_K.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q5_K.gguf) | Q5_K | 4.59GB |
|
32 |
+
| [deepseek-math-7b-rl.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q5_K_M.gguf) | Q5_K_M | 4.59GB |
|
33 |
+
| [deepseek-math-7b-rl.Q5_1.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q5_1.gguf) | Q5_1 | 4.86GB |
|
34 |
+
| [deepseek-math-7b-rl.Q6_K.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q6_K.gguf) | Q6_K | 5.28GB |
|
35 |
+
| [deepseek-math-7b-rl.Q8_0.gguf](https://huggingface.co/RichardErkhov/deepseek-ai_-_deepseek-math-7b-rl-gguf/blob/main/deepseek-math-7b-rl.Q8_0.gguf) | Q8_0 | 6.84GB |
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
Original model description:
|
41 |
+
---
|
42 |
+
license: other
|
43 |
+
license_name: deepseek
|
44 |
+
license_link: https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL
|
45 |
+
---
|
46 |
+
|
47 |
+
|
48 |
+
<p align="center">
|
49 |
+
<img width="500px" alt="DeepSeek Chat" src="https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/images/logo.png?raw=true">
|
50 |
+
</p>
|
51 |
+
<p align="center"><a href="https://www.deepseek.com/">[🏠Homepage]</a> | <a href="https://chat.deepseek.com/">[🤖 Chat with DeepSeek LLM]</a> | <a href="https://discord.gg/Tc7c45Zzu5">[Discord]</a> | <a href="https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/images/qr.jpeg">[Wechat(微信)]</a> </p>
|
52 |
+
|
53 |
+
<p align="center">
|
54 |
+
<a href="https://arxiv.org/pdf/2402.03300.pdf"><b>Paper Link</b>👁️</a>
|
55 |
+
</p>
|
56 |
+
|
57 |
+
<hr>
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
|
62 |
+
|
63 |
+
### 1. Introduction to DeepSeekMath
|
64 |
+
See the [Introduction](https://github.com/deepseek-ai/DeepSeek-Math) for more details.
|
65 |
+
|
66 |
+
### 2. How to Use
|
67 |
+
Here give some examples of how to use our model.
|
68 |
+
|
69 |
+
**Chat Completion**
|
70 |
+
|
71 |
+
❗❗❗ **Please use chain-of-thought prompt to test DeepSeekMath-Instruct and DeepSeekMath-RL:**
|
72 |
+
|
73 |
+
- English questions: **{question}\nPlease reason step by step, and put your final answer within \\boxed{}.**
|
74 |
+
|
75 |
+
- Chinese questions: **{question}\n请通过逐步推理来解答问题,并把最终答案放置于\\boxed{}中。**
|
76 |
+
|
77 |
+
```python
|
78 |
+
import torch
|
79 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
|
80 |
+
|
81 |
+
model_name = "deepseek-ai/deepseek-math-7b-instruct"
|
82 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
83 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
|
84 |
+
model.generation_config = GenerationConfig.from_pretrained(model_name)
|
85 |
+
model.generation_config.pad_token_id = model.generation_config.eos_token_id
|
86 |
+
|
87 |
+
messages = [
|
88 |
+
{"role": "user", "content": "what is the integral of x^2 from 0 to 2?\nPlease reason step by step, and put your final answer within \\boxed{}."}
|
89 |
+
]
|
90 |
+
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
|
91 |
+
outputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)
|
92 |
+
|
93 |
+
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
|
94 |
+
print(result)
|
95 |
+
```
|
96 |
+
|
97 |
+
Avoiding the use of the provided function `apply_chat_template`, you can also interact with our model following the sample template. Note that `messages` should be replaced by your input.
|
98 |
+
|
99 |
+
```
|
100 |
+
User: {messages[0]['content']}
|
101 |
+
|
102 |
+
Assistant: {messages[1]['content']}<|end▁of▁sentence|>User: {messages[2]['content']}
|
103 |
+
|
104 |
+
Assistant:
|
105 |
+
```
|
106 |
+
|
107 |
+
**Note:** By default (`add_special_tokens=True`), our tokenizer automatically adds a `bos_token` (`<|begin▁of▁sentence|>`) before the input text. Additionally, since the system prompt is not compatible with this version of our models, we DO NOT RECOMMEND including the system prompt in your input.
|
108 |
+
|
109 |
+
### 3. License
|
110 |
+
This code repository is licensed under the MIT License. The use of DeepSeekMath models is subject to the Model License. DeepSeekMath supports commercial use.
|
111 |
+
|
112 |
+
See the [LICENSE-MODEL](https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL) for more details.
|
113 |
+
|
114 |
+
### 4. Contact
|
115 |
+
|
116 |
+
If you have any questions, please raise an issue or contact us at [service@deepseek.com](mailto:service@deepseek.com).
|
117 |
+
|
118 |
+
|
119 |
+
|