Instructions to use QuantFactory/deepseek-math-7b-rl-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/deepseek-math-7b-rl-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/deepseek-math-7b-rl-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/deepseek-math-7b-rl-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/deepseek-math-7b-rl-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
- Ollama
How to use QuantFactory/deepseek-math-7b-rl-GGUF with Ollama:
ollama run hf.co/QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
- Unsloth Studio
How to use QuantFactory/deepseek-math-7b-rl-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/deepseek-math-7b-rl-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/deepseek-math-7b-rl-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/deepseek-math-7b-rl-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/deepseek-math-7b-rl-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/deepseek-math-7b-rl-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/deepseek-math-7b-rl-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.deepseek-math-7b-rl-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: deepseek
|
| 4 |
+
license_link: https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
base_model: deepseek-ai/deepseek-math-7b-rl
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# QuantFactory/deepseek-math-7b-rl-GGUF
|
| 10 |
+
This is quantized version of [deepseek-ai/deepseek-math-7b-rl](https://huggingface.co/deepseek-ai/deepseek-math-7b-rl) created using llama.cpp
|
| 11 |
+
|
| 12 |
+
# Model Description
|
| 13 |
+
|
| 14 |
+
<p align="center">
|
| 15 |
+
<img width="500px" alt="DeepSeek Chat" src="https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/images/logo.png?raw=true">
|
| 16 |
+
</p>
|
| 17 |
+
<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>
|
| 18 |
+
|
| 19 |
+
<p align="center">
|
| 20 |
+
<a href="https://arxiv.org/pdf/2402.03300.pdf"><b>Paper Link</b>👁️</a>
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
<hr>
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
### 1. Introduction to DeepSeekMath
|
| 30 |
+
See the [Introduction](https://github.com/deepseek-ai/DeepSeek-Math) for more details.
|
| 31 |
+
|
| 32 |
+
### 2. How to Use
|
| 33 |
+
Here give some examples of how to use our model.
|
| 34 |
+
|
| 35 |
+
**Chat Completion**
|
| 36 |
+
|
| 37 |
+
❗❗❗ **Please use chain-of-thought prompt to test DeepSeekMath-Instruct and DeepSeekMath-RL:**
|
| 38 |
+
|
| 39 |
+
- English questions: **{question}\nPlease reason step by step, and put your final answer within \\boxed{}.**
|
| 40 |
+
|
| 41 |
+
- Chinese questions: **{question}\n请通过逐步推理来解答问题,并把最终答案放置于\\boxed{}中。**
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
import torch
|
| 45 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
|
| 46 |
+
|
| 47 |
+
model_name = "deepseek-ai/deepseek-math-7b-instruct"
|
| 48 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 49 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
|
| 50 |
+
model.generation_config = GenerationConfig.from_pretrained(model_name)
|
| 51 |
+
model.generation_config.pad_token_id = model.generation_config.eos_token_id
|
| 52 |
+
|
| 53 |
+
messages = [
|
| 54 |
+
{"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{}."}
|
| 55 |
+
]
|
| 56 |
+
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
|
| 57 |
+
outputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)
|
| 58 |
+
|
| 59 |
+
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
|
| 60 |
+
print(result)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
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.
|
| 64 |
+
|
| 65 |
+
```
|
| 66 |
+
User: {messages[0]['content']}
|
| 67 |
+
|
| 68 |
+
Assistant: {messages[1]['content']}<|end▁of▁sentence|>User: {messages[2]['content']}
|
| 69 |
+
|
| 70 |
+
Assistant:
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
**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.
|
| 74 |
+
|
| 75 |
+
### 3. License
|
| 76 |
+
This code repository is licensed under the MIT License. The use of DeepSeekMath models is subject to the Model License. DeepSeekMath supports commercial use.
|
| 77 |
+
|
| 78 |
+
See the [LICENSE-MODEL](https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL) for more details.
|
| 79 |
+
|
| 80 |
+
### 4. Contact
|
| 81 |
+
|
| 82 |
+
If you have any questions, please raise an issue or contact us at [service@deepseek.com](mailto:service@deepseek.com).
|