Instructions to use dongboklee/gPRM-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dongboklee/gPRM-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dongboklee/gPRM-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dongboklee/gPRM-8B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dongboklee/gPRM-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dongboklee/gPRM-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dongboklee/gPRM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dongboklee/gPRM-8B
- SGLang
How to use dongboklee/gPRM-8B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dongboklee/gPRM-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dongboklee/gPRM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dongboklee/gPRM-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dongboklee/gPRM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dongboklee/gPRM-8B with Docker Model Runner:
docker model run hf.co/dongboklee/gPRM-8B
Improve model card: Add HF paper link and fix code snippet
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
---
|
| 2 |
base_model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
|
|
|
|
|
|
| 3 |
library_name: transformers
|
|
|
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
- base_model:adapter:deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
| 7 |
- lora
|
| 8 |
- transformers
|
| 9 |
- reward-model
|
| 10 |
-
license: apache-2.0
|
| 11 |
-
language:
|
| 12 |
-
- en
|
| 13 |
---
|
| 14 |
|
| 15 |
# gPRM-8B
|
|
@@ -18,7 +18,8 @@ language:
|
|
| 18 |
This model is a generative outcome reward model finetuned from [DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B), and the [training data](https://huggingface.co/datasets/dongboklee/train_gPRM) is generated by [QwQ-32B](https://huggingface.co/Qwen/QwQ-32B) on [this data](https://huggingface.co/datasets/dongboklee/train).
|
| 19 |
|
| 20 |
For details:
|
| 21 |
-
- **Paper:** [Rethinking Reward Models for Multi-Domain Test-Time Scaling](https://
|
|
|
|
| 22 |
- **Repository:** [https://github.com/db-Lee/Multi-RM](https://github.com/db-Lee/Multi-RM)
|
| 23 |
|
| 24 |
|
|
@@ -40,22 +41,40 @@ model.eval()
|
|
| 40 |
model.to(device)
|
| 41 |
|
| 42 |
# prompt formatting
|
| 43 |
-
question = 'Question: In Python 3, which of the following function convert a string to an int in python?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
solution = ["To convert a string to an integer in Python 3, we use the built-in function int().",
|
| 45 |
"The int() function takes two arguments: the string to be converted and an optional base (default is 10, which is for decimal).",
|
| 46 |
-
"For example: int(\"123\", 10) converts the string \"123\" to the integer 123.",
|
| 47 |
"Looking at the options, we can see that the correct function is option E: int(x [,base]).",
|
| 48 |
"The answer is (E)."]
|
| 49 |
category_name = "computer science"
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
# Create the prompt
|
| 55 |
prompt_text = (
|
| 56 |
-
f"You are given a {category_name} problem and a proposed step-by-step solution:\
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
"Review and critique each step in the proposed solution to determine whether each step is correct. If the solution is incomplete, only verify the provided steps."
|
| 60 |
)
|
| 61 |
|
|
@@ -78,7 +97,10 @@ with torch.no_grad():
|
|
| 78 |
)
|
| 79 |
|
| 80 |
# compute reward
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
| 82 |
yes_logit, no_logit = logits[yes_id].item(), logits[no_id].item()
|
| 83 |
reward = math.exp(yes_logit) / (math.exp(yes_logit) + math.exp(no_logit))
|
| 84 |
```
|
|
|
|
| 1 |
---
|
| 2 |
base_model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
library_name: transformers
|
| 6 |
+
license: apache-2.0
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
tags:
|
| 9 |
- base_model:adapter:deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
| 10 |
- lora
|
| 11 |
- transformers
|
| 12 |
- reward-model
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# gPRM-8B
|
|
|
|
| 18 |
This model is a generative outcome reward model finetuned from [DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B), and the [training data](https://huggingface.co/datasets/dongboklee/train_gPRM) is generated by [QwQ-32B](https://huggingface.co/Qwen/QwQ-32B) on [this data](https://huggingface.co/datasets/dongboklee/train).
|
| 19 |
|
| 20 |
For details:
|
| 21 |
+
- **Paper:** [Rethinking Reward Models for Multi-Domain Test-Time Scaling](https://huggingface.co/papers/2510.00492) (Hugging Face Paper)
|
| 22 |
+
- **arXiv Paper:** [Rethinking Reward Models for Multi-Domain Test-Time Scaling](https://arxiv.org/abs/2510.00492)
|
| 23 |
- **Repository:** [https://github.com/db-Lee/Multi-RM](https://github.com/db-Lee/Multi-RM)
|
| 24 |
|
| 25 |
|
|
|
|
| 41 |
model.to(device)
|
| 42 |
|
| 43 |
# prompt formatting
|
| 44 |
+
question = 'Question: In Python 3, which of the following function convert a string to an int in python?
|
| 45 |
+
A. short(x)
|
| 46 |
+
B. float(x)
|
| 47 |
+
C. integer(x [,base])
|
| 48 |
+
D. double(x)
|
| 49 |
+
E. int(x [,base])
|
| 50 |
+
F. long(x [,base] )
|
| 51 |
+
G. num(x)
|
| 52 |
+
H. str(x)
|
| 53 |
+
I. char(x)
|
| 54 |
+
J. digit(x [,base])'
|
| 55 |
solution = ["To convert a string to an integer in Python 3, we use the built-in function int().",
|
| 56 |
"The int() function takes two arguments: the string to be converted and an optional base (default is 10, which is for decimal).",
|
| 57 |
+
"For example: int(\\\"123\\\", 10) converts the string \\\"123\\\" to the integer 123.",
|
| 58 |
"Looking at the options, we can see that the correct function is option E: int(x [,base]).",
|
| 59 |
"The answer is (E)."]
|
| 60 |
category_name = "computer science"
|
| 61 |
+
steps = [ f"Step {str(i+1)}: {step}" for i, step in enumerate(solution) ]
|
| 62 |
+
prefix = "
|
| 63 |
+
".join(steps)
|
| 64 |
|
| 65 |
# Create the prompt
|
| 66 |
prompt_text = (
|
| 67 |
+
f"You are given a {category_name} problem and a proposed step-by-step solution:\
|
| 68 |
+
\
|
| 69 |
+
"
|
| 70 |
+
f"[{category_name.capitalize()} Problem]\
|
| 71 |
+
{question}\
|
| 72 |
+
\
|
| 73 |
+
"
|
| 74 |
+
f"[Solution]\
|
| 75 |
+
{prefix}\
|
| 76 |
+
\
|
| 77 |
+
"
|
| 78 |
"Review and critique each step in the proposed solution to determine whether each step is correct. If the solution is incomplete, only verify the provided steps."
|
| 79 |
)
|
| 80 |
|
|
|
|
| 97 |
)
|
| 98 |
|
| 99 |
# compute reward
|
| 100 |
+
# `outputs.scores` contains the logits for each generated token.
|
| 101 |
+
# The model is expected to end its generation with " Yes" or " No".
|
| 102 |
+
# We take the logits of the very last generated token to compute the reward.
|
| 103 |
+
logits = outputs.scores[-1][0]
|
| 104 |
yes_logit, no_logit = logits[yes_id].item(), logits[no_id].item()
|
| 105 |
reward = math.exp(yes_logit) / (math.exp(yes_logit) + math.exp(no_logit))
|
| 106 |
```
|