Downloads · 30 days
16
9% of all-time downloads
vrashad/gpt-oss-20b-medical-az
gpt-oss-20b-medical-az is a text generation model from vrashad. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This is a fine-tuned version of the OpenAI GPT-OSS 20B model specialized for medical reasoning and diagnostic tasks in the Azerbaijani language. Article about FT - https://medium.com/@vrashad/gpt-oss-20b-modelinin-az%…
Downloads · 30 days
16
9% of all-time downloads
All-time downloads
187
Public
Repo size
315 MB
Likes
1
Public
Click a slice to open those files.
.pt192 MB · 44%
From the Hugging Face model README
This is a fine-tuned version of the OpenAI GPT-OSS 20B model specialized for medical reasoning and diagnostic tasks in the Azerbaijani language. Article about FT - https://medium.com/@vrashad/gpt-oss-20b-modelinin-az%C9%99rbaycan-tibbi-dataseti-il%C9%99-fine-tuning-edilm%C9%99si-c9abf4819ede
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("openai/gpt-oss-20b")
base_model = AutoModelForCausalLM.from_pretrained(
"openai/gpt-oss-20b",
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load PEFT adapter
model = PeftModel.from_pretrained(base_model, "vrashad/gpt-oss-20b-medical-az")
model = model.merge_and_unload()
# Generate response
messages = [
{"role": "system", "content": "reasoning language: Azerbaijani"},
{"role": "user", "content": "Ürək ağrısının səbəbləri nə ola bilər?"},
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
with torch.no_grad():
output_ids = model.generate(
input_ids,
max_new_tokens=2048,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
response = tokenizer.decode(
output_ids[0][input_ids.shape[1]:],
skip_special_tokens=True
)
print(response)
The training dataset consists of medical questions and answers with reasoning. Each sample follows this format:
<thinking>reasoning process</thinking>final answer