DeepSeek-R1-Medical-CoT

This model is a fine-tuned version of deepseek-ai/DeepSeek-R1-Distill-Llama-8B on medical reasoning data using QLoRA. It's specifically trained to improve clinical reasoning, diagnostics, and treatment planning capabilities.

Training Details

  • Base model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
  • Training dataset: FreedomIntelligence/medical-o1-reasoning-SFT (3000 samples)
  • Fine-tuning method: QLoRA with Unsloth
  • LoRA rank: 16
  • Training epochs: 1
  • Max sequence length: 2048

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "abnv22107/deepseek-r1-medical-cot"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

# For inference
prompt = """Below is a task description along with additional context provided in the input section. Your goal is to provide a well-reasoned response that effectively addresses the request.

Before crafting your answer, take a moment to carefully analyze the question. Develop a clear, step-by-step thought process to ensure your response is both logical and accurate.

### Task:
You are a medical expert specializing in clinical reasoning, diagnostics, and treatment planning. Answer the medical question below using your advanced knowledge.

### Query:
Your medical question here

### Answer:
<think>
"""

inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=1200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Limitations

This model is intended for research and educational purposes only and should not be used for actual medical diagnosis or treatment decisions.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train abnv22107/deepseek-r1-medical-cot