Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# 🧠 Rust-Master-thinking
|
| 2 |
|
| 3 |
This repository contains a fine-tuned version of
|
|
@@ -28,6 +47,43 @@ The training format follows:
|
|
| 28 |
</think>
|
| 29 |
{response}
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
## 🧩 Base Model
|
| 32 |
|
| 33 |
**unsloth/phi-4-reasoning**
|
|
@@ -53,6 +109,11 @@ The training format follows:
|
|
| 53 |
Scheduler cosine
|
| 54 |
Epochs 1
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
## 📚 Dataset
|
| 57 |
|
| 58 |
**Tesslate/Rust_Dataset**
|
|
@@ -66,43 +127,6 @@ Includes:
|
|
| 66 |
This dataset improves the model's ability to produce structured and
|
| 67 |
accurate explanations for Rust programming tasks.
|
| 68 |
|
| 69 |
-
## 🔧 How to Use
|
| 70 |
-
|
| 71 |
-
### Load model normally:
|
| 72 |
-
|
| 73 |
-
``` python
|
| 74 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 75 |
-
import torch
|
| 76 |
-
|
| 77 |
-
model_id = "SkyAsl/Rust-Master-thinking"
|
| 78 |
-
|
| 79 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 80 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
|
| 81 |
-
model.eval()
|
| 82 |
-
|
| 83 |
-
prompt = "Explain why Rust ownership prevents data races."
|
| 84 |
-
|
| 85 |
-
input_text = (
|
| 86 |
-
f"<|user|>\n{test_data[0]['prompt']}\n"
|
| 87 |
-
f"<|assistant|>\n<think>\n"
|
| 88 |
-
)
|
| 89 |
-
|
| 90 |
-
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|
| 91 |
-
|
| 92 |
-
with torch.no_grad():
|
| 93 |
-
output = model.generate(
|
| 94 |
-
**inputs,
|
| 95 |
-
max_new_tokens=500,
|
| 96 |
-
temperature=0.7,
|
| 97 |
-
top_p=0.9,
|
| 98 |
-
do_sample=True,
|
| 99 |
-
eos_token_id=tokenizer.convert_tokens_to_ids("</think>")
|
| 100 |
-
)
|
| 101 |
-
|
| 102 |
-
print(tokenizer.decode(output[0], skip_special_tokens=False))
|
| 103 |
-
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
## 🔍 Notes on Reasoning Tags
|
| 107 |
|
| 108 |
This model preserves **hidden reasoning structure**:
|
|
@@ -117,4 +141,4 @@ model is aligned to hide reasoning by default.
|
|
| 117 |
|
| 118 |
- **Unsloth** for optimized model training\
|
| 119 |
- **HuggingFace Transformers & PEFT** team\
|
| 120 |
-
- **Tesslate** for providing the Rust dataset
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- Tesslate/Rust_Dataset
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- unsloth/phi-4-reasoning
|
| 9 |
+
new_version: SkyAsl/Rust-Master-thinking
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
library_name: transformers
|
| 12 |
+
tags:
|
| 13 |
+
- Rust
|
| 14 |
+
- code
|
| 15 |
+
- text-generation-inference
|
| 16 |
+
- lora
|
| 17 |
+
- reasoning
|
| 18 |
+
- quantization
|
| 19 |
+
---
|
| 20 |
# 🧠 Rust-Master-thinking
|
| 21 |
|
| 22 |
This repository contains a fine-tuned version of
|
|
|
|
| 47 |
</think>
|
| 48 |
{response}
|
| 49 |
|
| 50 |
+
## 🔧 How to Use
|
| 51 |
+
|
| 52 |
+
### Load model normally:
|
| 53 |
+
|
| 54 |
+
``` python
|
| 55 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 56 |
+
import torch
|
| 57 |
+
|
| 58 |
+
model_id = "SkyAsl/Rust-Master-thinking"
|
| 59 |
+
|
| 60 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 61 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
|
| 62 |
+
model.eval()
|
| 63 |
+
|
| 64 |
+
prompt = "Explain why Rust ownership prevents data races."
|
| 65 |
+
|
| 66 |
+
input_text = (
|
| 67 |
+
f"<|user|>\n{test_data[0]['prompt']}\n"
|
| 68 |
+
f"<|assistant|>\n<think>\n"
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|
| 72 |
+
|
| 73 |
+
with torch.no_grad():
|
| 74 |
+
output = model.generate(
|
| 75 |
+
**inputs,
|
| 76 |
+
max_new_tokens=500,
|
| 77 |
+
temperature=0.7,
|
| 78 |
+
top_p=0.9,
|
| 79 |
+
do_sample=True,
|
| 80 |
+
eos_token_id=tokenizer.convert_tokens_to_ids("</think>")
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
+
print(tokenizer.decode(output[0], skip_special_tokens=False))
|
| 84 |
+
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
## 🧩 Base Model
|
| 88 |
|
| 89 |
**unsloth/phi-4-reasoning**
|
|
|
|
| 109 |
Scheduler cosine
|
| 110 |
Epochs 1
|
| 111 |
|
| 112 |
+
## Evaluation
|
| 113 |
+
| Epoch | Training Loss | Validation Loss |
|
| 114 |
+
|-------|----------------|------------------|
|
| 115 |
+
| 1 | 2.251500 | 2.191743 |
|
| 116 |
+
|
| 117 |
## 📚 Dataset
|
| 118 |
|
| 119 |
**Tesslate/Rust_Dataset**
|
|
|
|
| 127 |
This dataset improves the model's ability to produce structured and
|
| 128 |
accurate explanations for Rust programming tasks.
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
## 🔍 Notes on Reasoning Tags
|
| 131 |
|
| 132 |
This model preserves **hidden reasoning structure**:
|
|
|
|
| 141 |
|
| 142 |
- **Unsloth** for optimized model training\
|
| 143 |
- **HuggingFace Transformers & PEFT** team\
|
| 144 |
+
- **Tesslate** for providing the Rust dataset
|