PHI-4-R1-medical
- Developed by: c00cjz00
- License: apache-2.0
- Finetuned from model : unsloth/phi-4
- Inference example :
from unsloth import FastLanguageModel
import os
max_seq_length = 4096 # Choose any! We auto support RoPE Scaling internally!
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
load_in_4bit = False # Use 4bit quantization to reduce memory usage. Can be False.
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "c00cjz00/phi-4-R1-medical",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
attn_implementation="default",
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": "You are GENAI, an AI assistant created by NCHC. Provide clear, accurate, and helpful responses to the following instruction."},
{"role": "user", "content": "A 45-year-old man with a history of alcohol use, who has been abstinent for the past 10 years, presents with sudden onset dysarthria, shuffling gait, and intention tremors. Given this clinical presentation and history, what is the most likely diagnosis?"}
]
inputs = tokenizer.apply_chat_template ( messages, tokenize = True, add_generation_prompt = True, return_tensors = 'pt' ).to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = 2048, use_cache = True)
- Downloads last month
- 3
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.