Ankit Nayak commited on
Commit
891b352
Β·
verified Β·
1 Parent(s): c893f00

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +68 -39
README.md CHANGED
@@ -1,30 +1,23 @@
1
- ---
2
- license: apache-2.0
3
- base_model: Qwen/Qwen2.5-1.5B-Instruct
4
- tags:
5
- - decision-making
6
- - jev
7
- - jevbench
8
- - system-one
9
- - joint-expected-value
10
- - reasoning
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
- # QJev-1.5B: Qwen2.5-1.5B JEV Decision Model (System 1 Decision Engine)
 
23
 
24
- [![Hugging Face Model](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-QJev--1.5B-yellow)](https://huggingface.co/devankit7873/QJev-1.5B)
25
- [![JevBench Metamorphic](https://img.shields.io/badge/JevBench%20Score-71.5%25%20Calibrated-purple)](https://jevbench.github.io/)
26
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
27
- [![PyTorch 2.12](https://img.shields.io/badge/PyTorch-CUDA%2012.8-red.svg)](https://pytorch.org/)
 
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. Standalone Inference (No PEFT Required)
 
 
 
 
 
117
  ```python
118
- import torch
119
- from transformers import AutoTokenizer
120
- from modeling_qwen_decision_merged import QwenDecisionMergedModel
121
 
122
- model_id = "devankit7873/QJev-1.5B"
123
- tokenizer = AutoTokenizer.from_pretrained(model_id)
124
- model = QwenDecisionMergedModel(model_dir=model_id)
125
 
126
- prompt = "Production database CPU is spiking at 99%. What is the immediate priority?"
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
- probabilities = model.predict(prompt=prompt, tokenizer=tokenizer, choices=choices)
135
- for choice, prob in probabilities.items():
136
- print(f"{choice}: {prob * 100:.2f}%")
 
137
  ```
138
 
139
  **Output:**
140
  ```text
141
- Failover to read replica immediately: 72.41%
142
- Restart the primary database instance: 16.32%
143
- Increase connection pool limits: 7.85%
144
- Ignore the alert and monitor logs: 3.42%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ [![Hugging Face Model](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-QJev--1.5B-FFD21E?style=for-the-badge&logo=huggingface&logoColor=black)](https://huggingface.co/devankit7873/QJev-1.5B)
7
+ [![GitHub Repo](https://img.shields.io/badge/GitHub-QJev--1.5B-181717?style=for-the-badge&logo=github)](https://github.com/AnkitNayak-dev/QJev-1.5B)
8
+ [![JevBench Metamorphic](https://img.shields.io/badge/JevBench-71.5%25%20Score-8A2BE2?style=for-the-badge)](https://jevbench.github.io/)
9
+ [![License](https://img.shields.io/badge/License-Apache%202.0-2EA44F?style=for-the-badge)](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)** &nbsp;|&nbsp; **`decision_head.safetensors` (3.18 MB)** &nbsp;|&nbsp; **`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
  ---