Wildstash/dental-treatment-planning-2.5k
Viewer • Updated • 2.49k • 154 • 1
How to use Wildstash/Dental-AImodel-20B with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("openai/gpt-oss-20b")
model = PeftModel.from_pretrained(base_model, "Wildstash/Dental-AImodel-20B")A fine-tuned LoRA adapter for openai/gpt-oss-20b specialized in dental patient evaluations and clinical decision-making.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"openai/gpt-oss-20b",
device_map="auto",
torch_dtype=torch.bfloat16,
trust_remote_code=True
)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("openai/gpt-oss-20b", trust_remote_code=True)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "Wildstash/dental-gpt-qlora")
# Example usage
messages = [
{"role": "system", "content": "You are an expert dental clinician providing comprehensive patient care."},
{"role": "user", "content": "Please evaluate this dental patient: 45M with severe tooth pain, swelling, fever 101°F."}
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=500,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)
The model was fine-tuned on 2,494 dental patient cases covering:
The fine-tuned model demonstrates improved:
If you use this model, please cite:
@misc{dental-gpt-qlora,
title={Dental GPT: A Fine-tuned Language Model for Dental Clinical Decision Support},
author={Your Name},
year={2024},
url={https://huggingface.co/Wildstash/dental-gpt-qlora}
}
Base model
openai/gpt-oss-20b