Instructions to use prithvi1029/deepseek-medquad-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithvi1029/deepseek-medquad-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="prithvi1029/deepseek-medquad-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("prithvi1029/deepseek-medquad-lora", dtype="auto") - PEFT
How to use prithvi1029/deepseek-medquad-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
DeepSeek MedQuAD LoRA Adapter
This repository contains a LoRA (PEFT) adapter fine-tuned for medical Q&A on the MedQuAD-style dataset.
Base model
- deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_id = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
adapter_id = "prithvi1029/deepseek-medquad-lora"
tok = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_id, device_map='auto', torch_dtype=torch.float16, trust_remote_code=True
)
model = PeftModel.from_pretrained(model, adapter_id)
prompt = "Question: What is diabetic retinopathy?\nAnswer:"
inputs = tok(prompt, return_tensors='pt').to(model.device)
out = model.generate(**inputs, max_new_tokens=128)
print(tok.decode(out[0], skip_special_tokens=True))
Disclaimer
This model is for research and educational purposes only and not medical advice.