Text Generation
Transformers
Safetensors
quantumindssi
sovereign-ai
edge-computing
healthcare-medical-ai
drug-interactions
pharmacovigilance
ddi
patient-safety
09_drug_interaction_predictor
finetuned
lora
conversational
Instructions to use QuantumindSSI/09-drug-interaction-predictor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantumindSSI/09-drug-interaction-predictor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantumindSSI/09-drug-interaction-predictor") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("QuantumindSSI/09-drug-interaction-predictor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QuantumindSSI/09-drug-interaction-predictor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantumindSSI/09-drug-interaction-predictor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantumindSSI/09-drug-interaction-predictor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantumindSSI/09-drug-interaction-predictor
- SGLang
How to use QuantumindSSI/09-drug-interaction-predictor with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "QuantumindSSI/09-drug-interaction-predictor" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantumindSSI/09-drug-interaction-predictor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "QuantumindSSI/09-drug-interaction-predictor" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantumindSSI/09-drug-interaction-predictor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuantumindSSI/09-drug-interaction-predictor with Docker Model Runner:
docker model run hf.co/QuantumindSSI/09-drug-interaction-predictor
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +94 -0
- adapter_config.json +48 -0
- adapter_model.safetensors +3 -0
- chat_template.jinja +6 -0
- tokenizer.json +3 -0
- tokenizer_config.json +19 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- quantumindssi
|
| 7 |
+
- sovereign-ai
|
| 8 |
+
- edge-computing
|
| 9 |
+
- healthcare-medical-ai
|
| 10 |
+
- drug-interactions
|
| 11 |
+
- pharmacovigilance
|
| 12 |
+
- ddi
|
| 13 |
+
- patient-safety
|
| 14 |
+
- 09_drug_interaction_predictor
|
| 15 |
+
- finetuned
|
| 16 |
+
- lora
|
| 17 |
+
inference: true
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Drug Interaction Predictor
|
| 21 |
+
|
| 22 |
+
A fine-tuned Small Language Model (SLM) that predicts potential drug-drug interactions from medication lists, including severity, mechanism, evidence, and clinical recommendations.
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
| Attribute | Value |
|
| 27 |
+
|-----------|-------|
|
| 28 |
+
| **Developer** | QuantumIndSSI Ltd |
|
| 29 |
+
| **Base Model** | ./base_model |
|
| 30 |
+
| **Architecture** | Transformer decoder (causal LM) |
|
| 31 |
+
| **Fine-tuning Method** | LoRA (Low-Rank Adaptation) |
|
| 32 |
+
| **LoRA Rank** | 16 |
|
| 33 |
+
| **LoRA Alpha** | 32 |
|
| 34 |
+
| **License** | apache-2.0 |
|
| 35 |
+
|
| 36 |
+
## Intended Use
|
| 37 |
+
|
| 38 |
+
- Automated drug-drug interaction screening from medication lists
|
| 39 |
+
- Clinical decision support for pharmacists and prescribers
|
| 40 |
+
- Patient safety and pharmacovigilance workflows
|
| 41 |
+
- Edge deployment on Victron and other constrained hardware
|
| 42 |
+
|
| 43 |
+
## Training Data
|
| 44 |
+
|
| 45 |
+
- 100,000+ synthetic drug-drug interaction examples
|
| 46 |
+
- Drug classes: anticoagulants, statins, antibiotics, antidepressants, PPIs, NSAIDs, opioids, immunosuppressants, and more
|
| 47 |
+
- Interaction types: pharmacokinetic (CYP inhibition/induction, P-gp), pharmacodynamic (additive toxicity, QT prolongation, bleeding)
|
| 48 |
+
- Severity levels: Critical, High, Medium, Low
|
| 49 |
+
|
| 50 |
+
## Usage
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
model_id = "QuantumindSSI/09_drug_interaction_predictor"
|
| 54 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 55 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 56 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 57 |
+
|
| 58 |
+
prompt = """Medications: Warfarin, Aspirin, Omeprazole. Analyze for interactions."""
|
| 59 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 60 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 61 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Limitations
|
| 65 |
+
|
| 66 |
+
- Not a substitute for clinical pharmacologist review
|
| 67 |
+
- Synthetic training data may not capture all real-world interactions
|
| 68 |
+
- English only
|
| 69 |
+
- Always verify with FDA labels, clinical guidelines, and drug databases
|
| 70 |
+
|
| 71 |
+
## Hardware Requirements
|
| 72 |
+
|
| 73 |
+
| Target | RAM | Notes |
|
| 74 |
+
|--------|-----|-------|
|
| 75 |
+
| Cloud GPU | 4GB | FP16 inference |
|
| 76 |
+
| Workstation | 3GB | INT8 quantized |
|
| 77 |
+
| Victron Edge | 2-3GB | INT8/INT4 quantized, CPU |
|
| 78 |
+
|
| 79 |
+
## Citation
|
| 80 |
+
|
| 81 |
+
```bibtex
|
| 82 |
+
@misc{09_drug_interaction_predictor,
|
| 83 |
+
title={Drug Interaction Predictor},
|
| 84 |
+
author={QuantumIndSSI Ltd},
|
| 85 |
+
year={2026},
|
| 86 |
+
publisher={Hugging Face},
|
| 87 |
+
howpublished={\url{https://huggingface.co/QuantumindSSI/09_drug_interaction_predictor}}
|
| 88 |
+
}
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## Contact
|
| 92 |
+
|
| 93 |
+
- GitHub: https://github.com/QuantumindSSI
|
| 94 |
+
- HuggingFace: https://huggingface.co/QuantumindSSI
|
adapter_config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "./base_model",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 32,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.05,
|
| 22 |
+
"lora_ga_config": null,
|
| 23 |
+
"megatron_config": null,
|
| 24 |
+
"megatron_core": "megatron.core",
|
| 25 |
+
"modules_to_save": null,
|
| 26 |
+
"peft_type": "LORA",
|
| 27 |
+
"peft_version": "0.19.1",
|
| 28 |
+
"qalora_group_size": 16,
|
| 29 |
+
"r": 16,
|
| 30 |
+
"rank_pattern": {},
|
| 31 |
+
"revision": null,
|
| 32 |
+
"target_modules": [
|
| 33 |
+
"up_proj",
|
| 34 |
+
"o_proj",
|
| 35 |
+
"gate_proj",
|
| 36 |
+
"q_proj",
|
| 37 |
+
"down_proj",
|
| 38 |
+
"v_proj",
|
| 39 |
+
"k_proj"
|
| 40 |
+
],
|
| 41 |
+
"target_parameters": null,
|
| 42 |
+
"task_type": "CAUSAL_LM",
|
| 43 |
+
"trainable_token_indices": null,
|
| 44 |
+
"use_bdlora": null,
|
| 45 |
+
"use_dora": false,
|
| 46 |
+
"use_qalora": false,
|
| 47 |
+
"use_rslora": false
|
| 48 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3261071c1d0bc4d9455f5587c7dadf5c62cbba6583fb1fc7e408482c7a9b9ec
|
| 3 |
+
size 35237104
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
|
| 2 |
+
You are a helpful assistant.<|im_end|>
|
| 3 |
+
' }}{% endif %}{{'<|im_start|>' + message['role'] + '
|
| 4 |
+
' + message['content'] + '<|im_end|>' + '
|
| 5 |
+
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 6 |
+
' }}{% endif %}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48f722bc04c884e2fe1525fdcd85a1293a8499b6e620c1ac7c083c49632305fb
|
| 3 |
+
size 11418262
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>"
|
| 11 |
+
],
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"local_files_only": false,
|
| 14 |
+
"model_max_length": 32768,
|
| 15 |
+
"pad_token": "<|endoftext|>",
|
| 16 |
+
"split_special_tokens": false,
|
| 17 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 18 |
+
"unk_token": null
|
| 19 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cfe785344b09ca6b75b83b0d922432900c2ddfcadb5752729651ed60ac7f620
|
| 3 |
+
size 5265
|