Text Generation
Transformers
Safetensors
English
t5
molt5
drug-drug-interaction
biomedical
text-generation-inference
Instructions to use acdsd/DDI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use acdsd/DDI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="acdsd/DDI")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("acdsd/DDI") model = AutoModelForSeq2SeqLM.from_pretrained("acdsd/DDI", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use acdsd/DDI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "acdsd/DDI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "acdsd/DDI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/acdsd/DDI
- SGLang
How to use acdsd/DDI 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 "acdsd/DDI" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "acdsd/DDI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "acdsd/DDI" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "acdsd/DDI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use acdsd/DDI with Docker Model Runner:
docker model run hf.co/acdsd/DDI
Update README.md
Browse files
README.md
CHANGED
|
@@ -33,10 +33,11 @@ This model was further fine-tuned on a custom drug–drug interaction dataset to
|
|
| 33 |
```python
|
| 34 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 35 |
|
| 36 |
-
tokenizer = T5Tokenizer.from_pretrained("
|
| 37 |
-
model = T5ForConditionalGeneration.from_pretrained("
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
query = "interaction between ibuprofen and paracetamol"
|
| 40 |
inputs = tokenizer(query, return_tensors="pt")
|
| 41 |
outputs = model.generate(**inputs, num_beams=4, max_length=128)
|
| 42 |
print(tokenizer.decode(outputs, skip_special_tokens=True))
|
|
@@ -57,5 +58,5 @@ If you use this model:
|
|
| 57 |
title={MolT5 Fine-tuned for Drug–Drug Interaction Prediction},
|
| 58 |
year={2025},
|
| 59 |
author={Your Name},
|
| 60 |
-
url={https://huggingface.co/
|
| 61 |
} -->
|
|
|
|
| 33 |
```python
|
| 34 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 35 |
|
| 36 |
+
tokenizer = T5Tokenizer.from_pretrained("acdsd/DDI")
|
| 37 |
+
model = T5ForConditionalGeneration.from_pretrained("acdsd/DDI")
|
| 38 |
+
|
| 39 |
+
query = "[DRUG1] ibuprofen SMILES CC(C)CC1=CC=C(C=C1)C(C)C(=O)O [DRUG2] paracetamol SMILES CC(=O)NC1=CC=C(O)C=C1"
|
| 40 |
|
|
|
|
| 41 |
inputs = tokenizer(query, return_tensors="pt")
|
| 42 |
outputs = model.generate(**inputs, num_beams=4, max_length=128)
|
| 43 |
print(tokenizer.decode(outputs, skip_special_tokens=True))
|
|
|
|
| 58 |
title={MolT5 Fine-tuned for Drug–Drug Interaction Prediction},
|
| 59 |
year={2025},
|
| 60 |
author={Your Name},
|
| 61 |
+
url={https://huggingface.co/acdsd/DDI}
|
| 62 |
} -->
|