RichardErkhov commited on
Commit
78ec720
1 Parent(s): 8cfac0e

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +96 -0
README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 - bnb 8bits
11
+ - Model creator: https://huggingface.co/deepseek-ai/
12
+ - Original model: https://huggingface.co/deepseek-ai/deepseek-math-7b-rl/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ license: other
20
+ license_name: deepseek
21
+ license_link: https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL
22
+ ---
23
+
24
+
25
+ <p align="center">
26
+ <img width="500px" alt="DeepSeek Chat" src="https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/images/logo.png?raw=true">
27
+ </p>
28
+ <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>
29
+
30
+ <p align="center">
31
+ <a href="https://arxiv.org/pdf/2402.03300.pdf"><b>Paper Link</b>👁️</a>
32
+ </p>
33
+
34
+ <hr>
35
+
36
+
37
+
38
+
39
+
40
+ ### 1. Introduction to DeepSeekMath
41
+ See the [Introduction](https://github.com/deepseek-ai/DeepSeek-Math) for more details.
42
+
43
+ ### 2. How to Use
44
+ Here give some examples of how to use our model.
45
+
46
+ **Chat Completion**
47
+
48
+ ❗❗❗ **Please use chain-of-thought prompt to test DeepSeekMath-Instruct and DeepSeekMath-RL:**
49
+
50
+ - English questions: **{question}\nPlease reason step by step, and put your final answer within \\boxed{}.**
51
+
52
+ - Chinese questions: **{question}\n请通过逐步推理来解答问题,并把最终答案放置于\\boxed{}中。**
53
+
54
+ ```python
55
+ import torch
56
+ from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
57
+
58
+ model_name = "deepseek-ai/deepseek-math-7b-instruct"
59
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
60
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
61
+ model.generation_config = GenerationConfig.from_pretrained(model_name)
62
+ model.generation_config.pad_token_id = model.generation_config.eos_token_id
63
+
64
+ messages = [
65
+ {"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{}."}
66
+ ]
67
+ input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
68
+ outputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)
69
+
70
+ result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
71
+ print(result)
72
+ ```
73
+
74
+ 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.
75
+
76
+ ```
77
+ User: {messages[0]['content']}
78
+
79
+ Assistant: {messages[1]['content']}<|end▁of▁sentence|>User: {messages[2]['content']}
80
+
81
+ Assistant:
82
+ ```
83
+
84
+ **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.
85
+
86
+ ### 3. License
87
+ This code repository is licensed under the MIT License. The use of DeepSeekMath models is subject to the Model License. DeepSeekMath supports commercial use.
88
+
89
+ See the [LICENSE-MODEL](https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL) for more details.
90
+
91
+ ### 4. Contact
92
+
93
+ If you have any questions, please raise an issue or contact us at [service@deepseek.com](mailto:service@deepseek.com).
94
+
95
+
96
+