Text Generation
Safetensors
English
llama
unsloth
medical
clinical-reasoning

Medical-Reasoning-LLaMA-8B

Model Description

This model is a fine-tuned version of LLaMA-8B, trained with Unsloth for efficiency.
It is designed to provide evidence-driven clinical reasoning and a concise final answer.

  • Base Model: Meta-Llama-3-8B-Instruct
  • Fine-tuning method: SFT(Supervised Fine-Tuning),LoRA (merged for HF compatibility)
  • Library: Unsloth
  • Domain: Medical Q&A, Clinical Reasoning

⚠️ Disclaimer: This model is for research & educational purposes only. Not for clinical use.


Inference

from unsloth import FastLanguageModel
import torch

model_name = "Vamsikrishna2004/Medical-Reasoning-Llama-8B"

max_seq_length = 2048
dtype = torch.float16
load_in_4bit = True

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name=model_name,
    max_seq_length=max_seq_length,
    dtype=dtype,
    load_in_4bit=load_in_4bit,
)

# Set the model to inference mode for text generation
FastLanguageModel.for_inference(model)

from transformers import TextStreamer

new_prompt = """You are an evidence-driven clinical assistant. Always include clear clinical reasoning and a concise final answer. If the case looks emergent, advise immediate in-person care.

### Question:
A 78 year old man with a history of smoking presents with a new, persistent cough and weight loss. A chest X-ray shows a mass in the right lung. What is the most likely diagnosis and what is the next step in management?

### Clinical Reasoning:
"""

inputs = tokenizer(
    [new_prompt], return_tensors="pt"
).to("cuda")

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    use_cache=True,
    streamer=TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True),
)

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 Vamsikrishna2004/Medical-Reasoning-Llama-8B