Views
No views yet

1from transformers import AutoTokenizer
2from vllm import LLM, SamplingParams
3
4model_path = "rubricreward/R3-Phi-4-reasoning-plus-4k"
5tokenizer = AutoTokenizer.from_pretrained(model_path)
6sampling_params = SamplingParams(temperature=0.8, top_p=0.95, max_tokens=32768, min_p=0, top_k=50)
7
8llm = LLM(
9 model=model_path,
10 dtype="bfloat16",
11 max_model_len=10000,
12 tensor_parallel_size=2,
13 gpu_memory_utilization=0.9,
14 enforce_eager=True,
15)
16
17messages: list[dict[str, str]] = [
18 {'content': "Evaluate the response based on the given task, input, response, and evaluation rubric. Provide a fair and detailed assessment following the rubric...", 'role': 'user'}
19]
20
21list_text = tokenizer.apply_chat_template(
22 messages,
23 tokenize=False,
24 add_generation_prompt=True,
25 enable_thinking=True # Switch between thinking and non-thinking modes.
26)
27
28outputs = llm.generate(list_text, sampling_params)1@article{anugraha2025r3,
2 title={R3: Robust Rubric-Agnostic Reward Models},
3 author={Anugraha, David and Tang, Zilu and Miranda, Lester James V. and Zhao, Hanyang and Farhansyah, Mohammad Rifqi and Kuwanto, Garry and Wijaya, Derry and Winata, Genta Indra},
4 journal={arXiv preprint arXiv:2505.13388},
5 year={2025}
6}