Phora68 commited on
Commit
cce9839
Β·
verified Β·
1 Parent(s): c3b0f72

Update model card

Browse files
Files changed (1) hide show
  1. README.md +103 -12
README.md CHANGED
@@ -1,19 +1,110 @@
1
  ---
 
 
2
  tags:
3
- - gguf
4
- - llama.cpp
5
- - unsloth
 
 
 
 
 
 
6
  ---
7
 
8
- # rapha : GGUF
9
 
10
- This model was finetuned and converted to GGUF format using [Unsloth](https://github.com/unslothai/unsloth).
 
 
 
11
 
12
- **Example usage**:
13
- - For text only LLMs: `llama-cli -hf Phora68/rapha --jinja`
14
- - For multimodal models: `llama-mtmd-cli -hf Phora68/rapha --jinja`
 
 
 
15
 
16
- ## Available Model files:
17
- - `merged.Q4_K_M.gguf`
18
- This was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth)
19
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: other
3
+ base_model: unsloth/Qwen2.5-3B-Instruct-bnb-4bit
4
  tags:
5
+ - clinical
6
+ - medical
7
+ - healthcare
8
+ - qlora
9
+ - unsloth
10
+ - chatml
11
+ - rapha
12
+ language:
13
+ - en
14
  ---
15
 
16
+ # Rapha β€” Clinical AI Physician Assistant
17
 
18
+ Rapha conducts structured, empathetic clinical interviews across five stages
19
+ (greeting, OPQRST symptom exploration, medical history, red-flag screening,
20
+ escalation report) and hands a structured report to a physician. **Rapha
21
+ never diagnoses.**
22
 
23
+ - **Base model:** `unsloth/Qwen2.5-3B-Instruct-bnb-4bit`
24
+ - **Method:** QLoRA (Unsloth) β†’ curriculum SFT β†’ DPO
25
+ - **Chat template:** ChatML
26
+ - **Context window:** 8,192 tokens (training) / 4,096 (Ollama default)
27
+ - **LoRA config:** r=32, alpha=32, target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
28
+ - **Trained:** 2026-07-22
29
 
30
+ ## Training architecture (v2.3)
31
+
32
+ Single-trainer curriculum SFT: three phases concatenated into one ordered
33
+ dataset with a single cosine LR schedule. This avoids the optimizer restart
34
+ and warmup re-run issues of the previous multi-trainer approach.
35
+
36
+ | Phase | Data | Purpose |
37
+ |---|---|---|
38
+ | 1 | Stage1 + Stage4 + Adversarial | Interview boundaries + robustness |
39
+ | 2 | Stage2 + Stage3 | Clinical content (OPQRST + history) |
40
+ | 3 | Full mix + FullArc | Complete session flows (Stage1β†’5) |
41
+
42
+ ## Repo contents
43
+
44
+ | Path | Contents |
45
+ |---|---|
46
+ | `/` (root) | LoRA adapter (PEFT) β€” small, load on top of the base model |
47
+ | `merged/` | Full merged fp16 weights β€” standalone, no base model needed |
48
+ | `gguf/` | Quantised GGUF files (Q4_K_M, Q5_K_M, Q8_0) for Ollama / llama.cpp / LM Studio |
49
+ | `datasets/` | Raw JSONL training/validation/DPO datasets used for this run |
50
+
51
+ ## Training data
52
+
53
+ **Total training records: ~159,766**
54
+
55
+ | Dataset | Records | File |
56
+ |---|---|---|
57
+ | Stage 1 β€” Greetings | 25,000 | `stage1_greetings.jsonl` |
58
+ | Stage 2 β€” OPQRST | 40,344 | `stage2_opqrst.jsonl` |
59
+ | Stage 3 β€” History | 40,000 | `stage3_history.jsonl` |
60
+ | Stage 4 β€” Red Flags | 14,422 | `stage4_red_flags.jsonl` |
61
+ | Adversarial | 10,000 | `adversarial.jsonl` |
62
+ | Full-Arc Conversations | 30,000 | `full_arc_conversations.jsonl` |
63
+ | Validation | 1,100 | `val_sharegpt.jsonl` |
64
+ | DPO Preference Pairs | 3,000 | `preference_pairs.jsonl` |
65
+
66
+ Stage 1 greetings, Stage 2 OPQRST symptom exploration, Stage 3 medical
67
+ history, Stage 4 red-flag screening, and a multi-turn adversarial set
68
+ (self-diagnosis, symptom denial, medication refusal, minimised red flags,
69
+ prompt injection β€” a portion include a patient pushback turn to test
70
+ boundary-holding). Followed by DPO preference alignment on the pairs above.
71
+
72
+ ### Red-flag terms screened for
73
+
74
+ `worst headache`, `can't feel my legs`, `arm feels heavy and chest`, `can't breathe`, `loss of consciousness`, `sudden vision`, `neck stiff`, `light hurts`, `confused`, `won't stop bleeding`, `bilateral leg weakness`, `bladder dysfunction`, `tachypnoea`, `thunderclap`, `cauda equina`, `qsofa`, `meningitis`
75
+
76
+ ## Eval metrics (last training run)
77
+
78
+ | Metric | Value |
79
+ |---|---|
80
+ | _(no eval metrics captured)_ | β€” |
81
+
82
+ ## Usage β€” Ollama (GGUF)
83
+
84
+ ```bash
85
+ ollama create rapha -f Modelfile.q4_k_m
86
+ ollama run rapha
87
+ ```
88
+
89
+ ## Usage β€” Transformers (LoRA adapter)
90
+
91
+ ```python
92
+ from unsloth import FastLanguageModel
93
+
94
+ model, tokenizer = FastLanguageModel.from_pretrained(
95
+ model_name="Phora68/rapha",
96
+ max_seq_length=8192,
97
+ load_in_4bit=True,
98
+ )
99
+ FastLanguageModel.for_inference(model)
100
+ ```
101
+
102
+ ## Safety
103
+
104
+ Rapha is an information-gathering and triage-support tool. It is **not**
105
+ a diagnostic device and must not be deployed without physician oversight.
106
+ Red-flag detection and escalation responses should be validated against
107
+ the clinical accuracy benchmark before any clinical use.
108
+
109
+ ---
110
+ *Generated automatically by `train_rapha_llm.py` v2.3.*