Med-o1-1.7B is fine-tuned specifically for medical diagnostic reasoning. Using the CoT_Medical_Diagnosis dataset, the model has learned to not only provide medical diagnoses but also to explain the step-by-step clinical reasoning that leads to its conclusions.
This model is ideal for researchers, educators, and developers aiming to study, demonstrate, or integrate AI-assisted medical reasoning.
⚠️ Important: This model is not intended for actual medical diagnosis or treatment decisions. Outputs should not be relied upon as a substitute for professional medical judgment. Always consult licensed healthcare professionals.
Use the code below to get started with the model.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("khazarai/Med-o1-1.7B")
4model = AutoModelForCausalLM.from_pretrained(
5 "khazarai/Med-o1-1.7B",
6 device_map={"": 0}
7)
8
9question = """
10Explain the physiological significance of a high hematocrit level, the common medical term used to describe this condition, and list three potential underlying causes.
11"""
12
13messages = [
14 {"role" : "user", "content" : question}
15]
16text = tokenizer.apply_chat_template(
17 messages,
18 tokenize = False,
19 add_generation_prompt = True,
20 enable_thinking = True,
21)
22
23from transformers import TextStreamer
24_ = model.generate(
25 **tokenizer(text, return_tensors = "pt").to("cuda"),
26 max_new_tokens = 2048,
27 temperature = 0.6,
28 top_p = 0.95,
29 top_k = 20,
30 streamer = TextStreamer(tokenizer, skip_prompt = True),
31)
The model was fine-tuned on the
moremilk/CoT_Medical_Diagnosis dataset:
The dataset emphasizes transparent reasoning, helping the model learn to articulate logical steps for arriving at conclusions.