Text Classification
Transformers
Safetensors
PyTorch
qwen2
text-generation
causal-lm
qwen
decision-making
system-one
reasoning
jev
jevbench
joint-expected-value
classification
qlora
agent
decision-model
fast-inference
text-embeddings-inference
Instructions to use AnkitNayak-dev/QJev-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnkitNayak-dev/QJev-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AnkitNayak-dev/QJev-1.5B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AnkitNayak-dev/QJev-1.5B") model = AutoModelForCausalLM.from_pretrained("AnkitNayak-dev/QJev-1.5B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Ankit Nayak commited on
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,30 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
|
| 11 |
-
- classification
|
| 12 |
-
- qwen
|
| 13 |
-
datasets:
|
| 14 |
-
- SargeDev/jev-distill-corpus-v3
|
| 15 |
-
metrics:
|
| 16 |
-
- accuracy
|
| 17 |
-
- tvd
|
| 18 |
-
- kl_divergence
|
| 19 |
-
pipeline_tag: text-classification
|
| 20 |
---
|
| 21 |
|
| 22 |
-
#
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
|
| 29 |
**`QJev-1.5B`** (**Qwen2.5-1.5B JEV Decision Model**) is an open-weights, high-speed **System 1 Decision Model** built on `Qwen/Qwen2.5-1.5B-Instruct`. It attaches a calibrated **Multi-Layer Perceptron (MLP) Decision Head** and fine-tunes attention projection layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`) via **QLoRA** across all 655,806 samples of `SargeDev/jev-distill-corpus-v3`.
|
| 30 |
|
|
@@ -113,17 +106,19 @@ Trained from scratch locally on consumer silicon:
|
|
| 113 |
pip install torch transformers safetensors
|
| 114 |
```
|
| 115 |
|
| 116 |
-
### 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
```python
|
| 118 |
-
import
|
| 119 |
-
from transformers import AutoTokenizer
|
| 120 |
-
from modeling_qwen_decision_merged import QwenDecisionMergedModel
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
model = QwenDecisionMergedModel(model_dir=model_id)
|
| 125 |
|
| 126 |
-
|
| 127 |
choices = [
|
| 128 |
"Failover to read replica immediately",
|
| 129 |
"Restart the primary database instance",
|
|
@@ -131,17 +126,51 @@ choices = [
|
|
| 131 |
"Ignore the alert and monitor logs"
|
| 132 |
]
|
| 133 |
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
|
|
|
| 137 |
```
|
| 138 |
|
| 139 |
**Output:**
|
| 140 |
```text
|
| 141 |
-
Failover to read replica immediately:
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
```
|
| 146 |
|
| 147 |
---
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
# β‘ QJev-1.5B: Qwen2.5-1.5B JEV Decision Model
|
| 4 |
+
### High-Speed System 1 Real-Time Decision Engine (~31 ms Forward Pass)
|
| 5 |
+
|
| 6 |
+
[](https://huggingface.co/devankit7873/QJev-1.5B)
|
| 7 |
+
[](https://github.com/AnkitNayak-dev/QJev-1.5B)
|
| 8 |
+
[](https://jevbench.github.io/)
|
| 9 |
+
[](LICENSE)
|
| 10 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
### π¦ **Download Pre-Trained Weights on Hugging Face Hub:**
|
| 14 |
+
## π **[huggingface.co/devankit7873/QJev-1.5B](https://huggingface.co/devankit7873/QJev-1.5B)** π
|
| 15 |
|
| 16 |
+
**`model.safetensors` (3.08 GB Standalone Fused)** | **`decision_head.safetensors` (3.18 MB)** | **`lora_adapter/` (17.5 MB Edge PEFT)**
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
</div>
|
| 21 |
|
| 22 |
**`QJev-1.5B`** (**Qwen2.5-1.5B JEV Decision Model**) is an open-weights, high-speed **System 1 Decision Model** built on `Qwen/Qwen2.5-1.5B-Instruct`. It attaches a calibrated **Multi-Layer Perceptron (MLP) Decision Head** and fine-tunes attention projection layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`) via **QLoRA** across all 655,806 samples of `SargeDev/jev-distill-corpus-v3`.
|
| 23 |
|
|
|
|
| 106 |
pip install torch transformers safetensors
|
| 107 |
```
|
| 108 |
|
| 109 |
+
### 2. Run Inference Demo (1 Command)
|
| 110 |
+
```bash
|
| 111 |
+
python predict.py
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
### 3. Python API Integration
|
| 115 |
```python
|
| 116 |
+
from predict import QJevModel
|
|
|
|
|
|
|
| 117 |
|
| 118 |
+
# Loads weights directly from Hugging Face or local cache
|
| 119 |
+
model = QJevModel(model_id_or_path="devankit7873/QJev-1.5B")
|
|
|
|
| 120 |
|
| 121 |
+
context = "Production database CPU is spiking at 99%. What is the immediate priority?"
|
| 122 |
choices = [
|
| 123 |
"Failover to read replica immediately",
|
| 124 |
"Restart the primary database instance",
|
|
|
|
| 126 |
"Ignore the alert and monitor logs"
|
| 127 |
]
|
| 128 |
|
| 129 |
+
result = model.predict(context=context, choices=choices)
|
| 130 |
+
print(f"Recommended: {result['recommended']} (Confidence: {result['confidence']})")
|
| 131 |
+
for choice, prob in result['probabilities'].items():
|
| 132 |
+
print(f" - {choice}: {prob}")
|
| 133 |
```
|
| 134 |
|
| 135 |
**Output:**
|
| 136 |
```text
|
| 137 |
+
Recommended: Failover to read replica immediately (Confidence: 86.72%)
|
| 138 |
+
- Failover to read replica immediately: 86.72%
|
| 139 |
+
- Restart the primary database instance: 7.03%
|
| 140 |
+
- Double connection pool limits without scaling compute: 5.71%
|
| 141 |
+
- Silence alerts and monitor for next 15 minutes: 0.50%
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
+
---
|
| 145 |
+
|
| 146 |
+
## Repository Structure
|
| 147 |
+
|
| 148 |
+
```text
|
| 149 |
+
βββ README.md # Project showcase, benchmarks, and usage
|
| 150 |
+
βββ LICENSE # Apache 2.0 open-source license
|
| 151 |
+
βββ requirements.txt # Python dependencies
|
| 152 |
+
βββ predict.py # 1-click single-pass inference demo
|
| 153 |
+
β
|
| 154 |
+
βββ src/ # Core modeling and training pipeline
|
| 155 |
+
β βββ model.py # MLP Decision Head + Qwen integration
|
| 156 |
+
β βββ dataset.py # ChatML streaming dataset loader
|
| 157 |
+
β βββ train.py # Phase 1 baseline training script
|
| 158 |
+
β βββ train_phase2.py # Phase 2 QLoRA joint training script (655k steps)
|
| 159 |
+
β βββ evaluate.py # Evaluation metrics (TVD, Accuracy, KL loss)
|
| 160 |
+
β
|
| 161 |
+
βββ benchmark/ # Evaluation suites
|
| 162 |
+
β βββ run_jevbench.py # Official JevBench metamorphic evaluation runner
|
| 163 |
+
β
|
| 164 |
+
βββ reports/ # Complete empirical benchmark records
|
| 165 |
+
β βββ jevbench_aligned/ # Official JevBench scores (71.5% calibrated)
|
| 166 |
+
β βββ phase_1/ # Phase 1 baseline evaluation records
|
| 167 |
+
β βββ phase_2/ # Phase 2 evaluations across all 50k checkpoints
|
| 168 |
+
β
|
| 169 |
+
βββ scripts/ # Workflow utilities
|
| 170 |
+
βββ merge_and_export.py # LoRA fusing and safetensors export
|
| 171 |
+
βββ download_data.py # Dataset loader from Hugging Face
|
| 172 |
+
βββ download_model.py # Base model downloader
|
| 173 |
+
βββ upload_to_hf.py # Automated Hugging Face publisher
|
| 174 |
```
|
| 175 |
|
| 176 |
---
|