File size: 6,860 Bytes
e9aecb8
 
6db21a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e9aecb8
6db21a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
license: apache-2.0
language:
- en
base_model: Qwen/Qwen2.5-14B-Instruct
tags:
- pharmacovigilance
- gvp
- regulatory
- qwen2.5
- medical
- drug-safety
- instruction-tuning
- gguf
- safetensors
- llama.cpp
- ollama
pipeline_tag: text-generation
library_name: transformers
---

# ๐Ÿ’Š Open-GVP-Qwen2.5-14B-Instruct

> Domain-adapted **Qwen2.5-14B** model specialized in **Good Pharmacovigilance Practices (GVP)** guidelines issued by the European Medicines Agency (EMA).

This repository contains both the **merged Safetensors** version and **GGUF quantized** versions of the model.

**Available formats:**
- Merged Safetensors (for Transformers / vLLM / etc.)
- GGUF: `BF16`, `Q8_0`, `Q6_K`

---

## ๐Ÿ“– Model Description

**Open-GVP-Qwen2.5-14B-Instruct** is a domain-specialized version of [Qwen/Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct), fine-tuned using **LoRA** on a curated dataset of approximately **15,000 high-quality question-answer pairs** derived from the official EMA Good Pharmacovigilance Practices (GVP) guidelines.

The model covers **all GVP Modules and related Addendums**, with particular strength in areas such as:

- ICSR collection, management, and submission (Module VI)
- Signal management (Module IX)
- Risk management systems (Module V)
- Periodic safety update reports (PSUR / PBRER)
- Pharmacovigilance system master file (PSMF)

> **Important**: This model performs best when used as part of a **RAG (Retrieval-Augmented Generation)** pipeline alongside the original GVP PDF documents, rather than as a standalone source of regulatory advice.

---

## ๐Ÿ—‚๏ธ Coverage

| Category | Details |
| :--- | :--- |
| **GVP Modules** | All Modules |
| **Addendum** | Included |
| **Training Data Size** | ~15,000 instruction-format Q&A pairs |
| **Primary Focus** | Regulatory interpretation & PV operations |

---

## ๐Ÿ“ฆ Available Formats

| Format | Files | Best For |
| :--- | :--- | :--- |
| **Merged Safetensors** | `model-00001-of-00004.safetensors` (4 shards) + config | Transformers, vLLM, TGI, full-precision inference |
| **GGUF BF16** | `Open-GVP-Qwen2.5-14B-BF16.gguf` | Highest quality GGUF |
| **GGUF Q8_0** | `Open-GVP-Qwen2.5-14B-Q8_0.gguf` | Excellent quality / speed balance |
| **GGUF Q6_K** | `Open-GVP-Qwen2.5-14B-Q6_K.gguf` | Good quality with lower resource usage |

**Recommendation**:  
- Use **Safetensors** for maximum quality and flexibility.  
- Use **Q8_0** or **Q6_K** GGUF for local / CPU-friendly deployment.

---

## ๐Ÿš€ Quick Start

### 1. Transformers (Safetensors)

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "drvivekpoojary/Open-GVP-Qwen2.5-14B-Instruct"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

messages = [
    {"role": "system", "content": "You are an expert pharmacovigilance assistant specialized in EMA Good Pharmacovigilance Practices (GVP)."},
    {"role": "user", "content": "What is the definition of a serious adverse reaction according to GVP Module VI?"}
]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

### 2. Ollama (GGUF)

```bash
# Recommended (Q8_0)
ollama run hf.co/drvivekpoojary/Open-GVP-Qwen2.5-14B-Instruct:Q8_0

# Alternative options
ollama run hf.co/drvivekpoojary/Open-GVP-Qwen2.5-14B-Instruct:Q6_K
ollama run hf.co/drvivekpoojary/Open-GVP-Qwen2.5-14B-Instruct:BF16
```

### 3. llama.cpp

```bash
./llama-cli \
  -m Open-GVP-Qwen2.5-14B-Q8_0.gguf \
  -p "What is the definition of a serious adverse reaction according to GVP Module VI?" \
  -n 512 \
  -c 4096 \
  --temp 0.2
```

### 4. Python (llama-cpp-python)

```python
from llama_cpp import Llama

llm = Llama(
    model_path="Open-GVP-Qwen2.5-14B-Q8_0.gguf",
    n_ctx=4096,
    n_gpu_layers=-1,      # set to 0 for pure CPU
    verbose=False
)

response = llm.create_chat_completion(
    messages=[
        {
            "role": "system",
            "content": "You are an expert pharmacovigilance assistant specialized in EMA Good Pharmacovigilance Practices (GVP)."
        },
        {
            "role": "user",
            "content": "What is the definition of a serious adverse reaction according to GVP Module VI?"
        }
    ],
    max_tokens=512,
    temperature=0.2
)

print(response["choices"][0]["message"]["content"])
```

---

## โœ… Recommended Use Cases

| Use Case | Description |
| :--- | :--- |
| **GVP Knowledge Assistant** | Answer questions on GVP modules, definitions, and requirements |
| **PV Staff Training & Onboarding** | Support training of new pharmacovigilance team members |
| **RAG Pipeline** | Use as the generator together with official GVP PDFs |
| **Internal Regulatory Chatbot** | Backend for company-internal PV compliance assistants |
| **Offline / Air-gapped Environments** | Run completely locally without internet access |
| **Edge & Low-Resource Deployment** | Suitable for laptops and workstations (especially GGUF versions) |

### โŒ Not Recommended For

- Standalone regulatory decision-making
- High-stakes compliance or submission decisions without human review
- Replacing qualified pharmacovigilance professionals
- Use outside the scope of EMA GVP guidelines
- Generating content for regulatory submissions without expert verification

---

## ๐Ÿ”ง Training Details

| Property | Value |
| :--- | :--- |
| **Base Model** | Qwen/Qwen2.5-14B-Instruct |
| **Fine-tuning Method** | QLoRA |
| **LoRA Rank** | 32 |
| **LoRA Alpha** | 64 |
| **LoRA Dropout** | 0.05 |
| **Training Data** | ~15,000 GVP Q&A pairs (all modules) |
| **Epochs** | 4 |
| **Context Length** | 768 |
| **Precision** | bfloat16 |
| **Framework** | LlamaFactory |
| **Hardware** | NVIDIA GPU (16 GB VRAM) |

---

## โš ๏ธ Disclaimer

- This model is intended for **research, educational, and internal professional support purposes only**.

- It does **not** constitute regulatory advice. All outputs should be carefully reviewed by qualified pharmacovigilance professionals before being used in any compliance, case processing, reporting, or decision-making context.

- The model may produce incomplete, outdated, or inaccurate responses, particularly on complex or nuanced regulatory questions. The author assumes no liability for any decisions made based on the modelโ€™s outputs.

- **No In-Training Evaluation:** Evaluation loss (`eval_loss`) was not computed during training, and per-epoch checkpoints were not preserved.
---

## ๐Ÿ‘ค Author

**Dr. Vivek Poojary**  

---

## ๐Ÿ“„ License

Apache License 2.0