Instructions to use QuantFactory/deepseek-math-7b-rl-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use QuantFactory/deepseek-math-7b-rl-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/deepseek-math-7b-rl-GGUF", filename="deepseek-math-7b-rl.Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use QuantFactory/deepseek-math-7b-rl-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # 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
Install from WinGet (Windows)
winget install llama.cpp # 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
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 new
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
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf QuantFactory/deepseek-math-7b-rl-GGUF:# Run inference directly in the terminal:
llama-cli -hf QuantFactory/deepseek-math-7b-rl-GGUF: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:# Run inference directly in the terminal:
./llama-cli -hf QuantFactory/deepseek-math-7b-rl-GGUF: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:# Run inference directly in the terminal:
./build/bin/llama-cli -hf QuantFactory/deepseek-math-7b-rl-GGUF:Use Docker
docker model run hf.co/QuantFactory/deepseek-math-7b-rl-GGUF:QuantFactory/deepseek-math-7b-rl-GGUF
This is quantized version of deepseek-ai/deepseek-math-7b-rl created using llama.cpp
Model Description
[🏠Homepage] | [🤖 Chat with DeepSeek LLM] | [Discord] | [Wechat(微信)]
1. Introduction to DeepSeekMath
See the Introduction for more details.
2. How to Use
Here give some examples of how to use our model.
Chat Completion
❗❗❗ Please use chain-of-thought prompt to test DeepSeekMath-Instruct and DeepSeekMath-RL:
English questions: {question}\nPlease reason step by step, and put your final answer within \boxed{}.
Chinese questions: {question}\n请通过逐步推理来解答问题,并把最终答案放置于\boxed{}中。
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
model_name = "deepseek-ai/deepseek-math-7b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
model.generation_config = GenerationConfig.from_pretrained(model_name)
model.generation_config.pad_token_id = model.generation_config.eos_token_id
messages = [
{"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{}."}
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
print(result)
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.
User: {messages[0]['content']}
Assistant: {messages[1]['content']}<|end▁of▁sentence|>User: {messages[2]['content']}
Assistant:
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.
3. License
This code repository is licensed under the MIT License. The use of DeepSeekMath models is subject to the Model License. DeepSeekMath supports commercial use.
See the LICENSE-MODEL for more details.
4. Contact
If you have any questions, please raise an issue or contact us at service@deepseek.com.
- Downloads last month
- 67
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for QuantFactory/deepseek-math-7b-rl-GGUF
Base model
deepseek-ai/deepseek-math-7b-rl
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/deepseek-math-7b-rl-GGUF:# Run inference directly in the terminal: llama-cli -hf QuantFactory/deepseek-math-7b-rl-GGUF: