Views
No views yet
1from transformers import AutoModel, AutoTokenizer
2import torch
3
4path = 'manglu3935/Chiron-o1-8B'
5model = AutoModel.from_pretrained(
6 path,
7 torch_dtype=torch.bfloat16,
8 load_in_8bit=False,
9 low_cpu_mem_usage=True,
10 use_flash_attn=True,
11 trust_remote_code=True,
12 device_map="auto").eval()
13tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True, use_fast=False)
14
15# pure text inference
16question = "Which of the following imaging findings is most consistent with a pure arterial malformation (PAM)?\nA) A vascular network connecting arteries and veins with early venous drainage \nB) A dilated, tortuous arterial loop without venous communication \nC) A focal saccular outpouching of a cerebral artery with surrounding edema \nD) A venous varix with adjacent arterial feeders\nLet's reason step-by-step to answer the above question."
17generation_config = dict(max_new_tokens=1024, do_sample=True)
18response = model.chat(tokenizer, None, question, generation_config)
19print(f'User: {question}\nAssistant: {response}')@article{sun2025enhancingstepbystepverifiablemedical,
title={Enhancing Step-by-Step and Verifiable Medical Reasoning in MLLMs},
author={Haoran Sun and Yankai Jiang and Wenjie Lou and Yujie Zhang and Wenjie Li and Lilong Wang and Mianxin Liu and Lei Liu and Xiaosong Wang},
journal={arXiv preprint arXiv:2506.16962},
year={2025}
}