Instructions to use 3rd-Degree-Burn/qwen3-0.6b-reward with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 3rd-Degree-Burn/qwen3-0.6b-reward with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("3rd-Degree-Burn/qwen3-0.6b-reward", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,8 +5,45 @@ tags: []
|
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
## Model Details
|
|
|
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
+
```
|
| 9 |
+
rm = trainer.model
|
| 10 |
+
rm.eval()
|
| 11 |
+
|
| 12 |
+
def render_pair_for_scoring(source_text, revision_text):
|
| 13 |
+
messages = [
|
| 14 |
+
{
|
| 15 |
+
"role": "user",
|
| 16 |
+
"content": f"{USER_PREFIX}\n\n{str(source_text).strip()}",
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"role": "assistant",
|
| 20 |
+
"content": f"{ASSISTANT_PREFIX}\n\n{str(revision_text).strip()}",
|
| 21 |
+
},
|
| 22 |
+
]
|
| 23 |
+
return apply_qwen_template_clean(messages)
|
| 24 |
+
|
| 25 |
+
def reward_score(source_text, revision_text):
|
| 26 |
+
text = render_pair_for_scoring(source_text, revision_text)
|
| 27 |
+
inputs = tokenizer(
|
| 28 |
+
text,
|
| 29 |
+
return_tensors="pt",
|
| 30 |
+
truncation=True,
|
| 31 |
+
max_length=MAX_LENGTH,
|
| 32 |
+
).to(rm.device)
|
| 33 |
+
|
| 34 |
+
with torch.no_grad():
|
| 35 |
+
logits = rm(**inputs).logits
|
| 36 |
+
|
| 37 |
+
return logits.squeeze().float().item()
|
| 38 |
+
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
```
|
| 42 |
+
row = split["test"][0]
|
| 43 |
+
|
| 44 |
+
print("chosen score: ", reward_score(row["prompt"], row["chosen"]))
|
| 45 |
+
print("rejected score:", reward_score(row["prompt"], row["rejected"]))
|
| 46 |
+
```
|
| 47 |
|
| 48 |
|
| 49 |
## Model Details
|