FreedomIntelligence/medical-o1-verifiable-problem
Viewer • Updated • 40.6k • 501 • 121
How to use kingabzpro/gpt-oss-20b-medical-qa with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="kingabzpro/gpt-oss-20b-medical-qa")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("kingabzpro/gpt-oss-20b-medical-qa", dtype="auto")How to use kingabzpro/gpt-oss-20b-medical-qa with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "kingabzpro/gpt-oss-20b-medical-qa"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kingabzpro/gpt-oss-20b-medical-qa",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/kingabzpro/gpt-oss-20b-medical-qa
How to use kingabzpro/gpt-oss-20b-medical-qa with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "kingabzpro/gpt-oss-20b-medical-qa" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kingabzpro/gpt-oss-20b-medical-qa",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "kingabzpro/gpt-oss-20b-medical-qa" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kingabzpro/gpt-oss-20b-medical-qa",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use kingabzpro/gpt-oss-20b-medical-qa with Docker Model Runner:
docker model run hf.co/kingabzpro/gpt-oss-20b-medical-qa
This model is a fine-tuned version of openai/gpt-oss-20b on the FreedomIntelligence/medical-o1-verifiable-problem dataset. It has been trained using TRL.
from transformers import pipeline
prompt = """<|start|>developer<|message|># Instructions
You are a medical expert with advanced knowledge in clinical reasoning and diagnostics. Respond with ONLY the final diagnosis/cause in ≤5 words.<|end|><|start|>user<|message|>An 88-year-old woman with osteoarthritis is experiencing mild epigastric discomfort and has vomited material resembling coffee grounds multiple times. Considering her use of naproxen, what is the most likely cause of her gastrointestinal blood loss?<|end|><|start|>assistant<|message|>"""
# Load pipeline
generator = pipeline(
"text-generation",
model="kingabzpro/gpt-oss-20b-medical-qa",
device="cuda" # or device=0
)
# Run inference (passing in chat-style format)
output = generator(
prompt,
max_new_tokens=20,
return_full_text=False
)[0]
print(output["generated_text"])
Output:
NSAID use
This model was trained with SFT.
Base model
openai/gpt-oss-20b