CoolFace
Modelpublic

ThomasBaruzier/DeepSeek-R1-ReDistill-Qwen-7B-v1.1-GGUF

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes2.3kdownloads
Model Card

<br><img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/FHc3IG1KAJn6N3s1TJLrS.webp" width="720"><br>

Llama.cpp imatrix quantizations of mobiuslabsgmbh/DeepSeek-R1-ReDistill-Qwen-7B-v1.1

Using llama.cpp commit 3ad5451 for quantization.

All quants were made using the imatrix option and Bartowski's calibration file.

<hr>

Perplexity table (the lower the better)

QuantSize (MB)PPLSize (%)Accuracy (%)PPL error rate
IQ1_S181529.373912.4949.920.53
IQ1_M194723.461113.4062.500.42
IQ2_XXS216723.825714.9161.540.46
IQ2_XS235420.541316.2071.380.39
IQ2_S247519.376317.0375.670.36
IQ2_M265122.300718.2465.750.44
Q2_K_S270217.544618.5983.570.31
Q2_K287616.942619.7986.540.29
IQ3_XXS297016.266820.4490.140.29
IQ3_XS319116.144321.9690.820.29
Q3_K_S333017.036422.9286.070.29
IQ3_S333716.104822.9691.040.29
IQ3_M340815.812823.4592.720.28
Q3_K_M363115.258024.9996.100.26
Q3_K_L389915.199726.8396.460.26
IQ4_XS402314.938527.6898.150.25
IQ4_NL423214.925729.1298.240.25
Q4_0423815.262129.1796.070.26
Q4_K_S425114.885229.2598.500.26
Q4_K_M446614.866630.7398.630.26
Q4_1464714.878931.9898.540.26
Q5_K_S506814.744934.8899.440.25
Q5_0508114.742534.9799.460.25
Q5_K_M519214.732735.7399.520.25
Q5_1549014.729337.7899.550.25
Q6_K596414.690741.0499.810.25
Q8_0772314.668653.1599.960.25
F161453114.66251001000.25

<hr>

This is a version of the <a href="https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B">DeepSeek-R1-Distill-Qwen-7B</a> model re-distilled for better performance.

Performance

Models<a href="https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B">DeepSeek-R1-Distill-Qwen-7B</a><a href="https://huggingface.co/mobiuslabsgmbh/DeepSeek-R1-ReDistill-Qwen-7B-v1.1">DeepSeek-R1-ReDistill-Qwen-7B-v1.1</a>
ARC (25-shot)<b>55.03</b>52.3
HellaSwag (10-shot)61.9<b>62.36</b>
MMLU (5-shot)56.75<b>59.53</b>
TruthfulQA-MC245.76<b>47.7</b>
Winogrande (5-shot)60.38<b>61.8</b>
GSM8K (5-shot)78.85<b>83.4</b>
Average59.78<b>61.18</b>
Models<a href="https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B">DeepSeek-R1-Distill-Qwen-7B</a><a href="https://huggingface.co/mobiuslabsgmbh/DeepSeek-R1-ReDistill-Qwen-7B-v1.1">DeepSeek-R1-ReDistill-Qwen-7B-v1.1</a>
GPQA (0-shot)30.9<b>34.99</b>
MMLU PRO (5-shot)28.83<b>31.02</b>
MUSR (0-shot)38.85<b>44.42</b>
BBH (3-shot)43.54<b>51.53</b>
IfEval (0-shot) - strict<b>42.33</b>35.49
IfEval (0-shot) - loose30.31<b>38.49</b>

Usage

Python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
compute_dtype = torch.bfloat16
device   = 'cuda'
model_id = "mobiuslabsgmbh/DeepSeek-R1-ReDistill-Qwen-7B-v1.1"

model     = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=compute_dtype, attn_implementation="sdpa", device_map=device)
tokenizer = AutoTokenizer.from_pretrained(model_id)

prompt  = "What is 1.5+102.2?"
chat    = tokenizer.apply_chat_template([{"role":"user", "content":prompt}], tokenize=True, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(chat.to(device), max_new_tokens=1024, do_sample=True) 
print(tokenizer.decode(outputs[0]))

Output:

<|begin▁of▁sentence|><|User|>What is 1.5+102.2?<|Assistant|><think>
First, I need to add the whole number parts of the two numbers. The whole numbers are 1 and 102, which add up to 103.

Next, I add the decimal parts of the two numbers. The decimal parts are 0.5 and 0.2, which add up to 0.7.

Finally, I combine the whole number and decimal parts to get the total sum. Adding 103 and 0.7 gives me 103.7.
</think>

To add the numbers \(1.5\) and \(102.2\), follow these steps:

1. **Add the whole number parts:**
   \[
   1 + 102 = 103
   \]

2. **Add the decimal parts:**
   \[
   0.5 + 0.2 = 0.7
   \]

3. **Combine the results:**
   \[
   103 + 0.7 = 103.7
   \]

**Final Answer:**
\[
\boxed{103.7}
\]<|end▁of▁sentence|>

HQQ

Run ~3.5x faster with <a href="https://github.com/mobiusml/hqq/">HQQ</a>. First, install the dependencies:

pip install hqq
Python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from hqq.models.hf.base import AutoHQQHFModel
from hqq.core.quantize import *

#Params
device        = 'cuda:0'
backend       = "torchao_int4" 
compute_dtype = torch.bfloat16 if backend=="torchao_int4" else torch.float16
model_id      = "mobiuslabsgmbh/DeepSeek-R1-ReDistill-Qwen-7B-v1.1"

#Load
tokenizer = AutoTokenizer.from_pretrained(model_id)
model     = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=compute_dtype, attn_implementation="sdpa")

#Quantize
quant_config = BaseQuantizeConfig(nbits=4, group_size=64, axis=1)
AutoHQQHFModel.quantize_model(model, quant_config=quant_config, compute_dtype=compute_dtype, device=device)

#Optimize
from hqq.utils.patching import prepare_for_inference
prepare_for_inference(model, backend=backend, verbose=False)

############################################################
#Generate (streaming)
from hqq.utils.generation_hf import HFGenerator
gen = HFGenerator(model, tokenizer, max_new_tokens=4096, do_sample=True, compile='partial').warmup()

prompt = "If A equals B, and C equals B - A, what would be the value of C?" 
out    = gen.generate(prompt, print_tokens=True)

############################################################
# #Generate (simple)
# from hqq.utils.generation_hf import patch_model_for_compiled_runtime
# patch_model_for_compiled_runtime(model, tokenizer, warmup=True)

# prompt = "If A equals B, and C equals B - A, what would be the value of C?" 
# chat    = tokenizer.apply_chat_template([{"role":"user", "content":prompt}], tokenize=True, add_generation_prompt=True, return_tensors="pt")
# outputs = model.generate(chat.to(device), max_new_tokens=8192, do_sample=True) 
# print(tokenizer.decode(outputs[0]))