Run this model with HF Jobs

Run Shayannasiri/MedFrame-R1-8B-SFT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/Shayannasiri/MedFrame-R1-8B-SFT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Shayannasiri/MedFrame-R1-8B-SFT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Shayannasiri/MedFrame-R1-8B-SFT. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/Shayannasiri/MedFrame-R1-8B-SFT. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

MedFrame

MedFrame-R1-8B-SFT

Medical multimodal reasoning model trained with MedFrame-R1, a reliable reinforcement learning framework for medical MLLMs.

Results

Accuracy (%) on 17 medical benchmarks (19,200 items), scored with deterministic rules and a three-judge panel. VQA and QA are the means over the 6 image-based and 11 text-based benchmarks; Macro is the mean over all 17 benchmarks and Micro is pooled over all samples. Bold marks the better of the two rows.

Results

Usage

from transformers import AutoModelForImageTextToText, AutoProcessor

model_id = "Shayannasiri/MedFrame-R1-8B-SFT"
model = AutoModelForImageTextToText.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)

messages = [{"role": "user", "content": [
    {"type": "image", "image": "image.png"},
    {"type": "text", "text": "Is there evidence of pneumothorax?"},
]}]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True,
                                       return_dict=True, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=1024)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

The model writes its reasoning before the final answer.

Intended use

Research only. Not for clinical decision making.

Citation

Paper coming soon.

Downloads last month
25
Safetensors
Model size
9B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Shayannasiri/MedFrame-R1-8B-SFT

Finetuned
(790)
this model

Datasets used to train Shayannasiri/MedFrame-R1-8B-SFT

Collection including Shayannasiri/MedFrame-R1-8B-SFT

⌂ 换网址