(args, messages, max_tokens=None)
| 68 | |
| 69 | |
| 70 | def build_query_kwargs(args, messages, max_tokens=None): |
| 71 | query_kwargs = { |
| 72 | "model": args.model, |
| 73 | "messages": messages, |
| 74 | "max_tokens": args.max_tokens if max_tokens is None else max_tokens, |
| 75 | "temperature": args.temperature, |
| 76 | "stream": False, |
| 77 | } |
| 78 | if args.top_p is not None: |
| 79 | query_kwargs["top_p"] = args.top_p |
| 80 | if args.repetition_penalty is not None: |
| 81 | query_kwargs["presence_penalty"] = args.repetition_penalty |
| 82 | |
| 83 | extra_body = {} |
| 84 | if args.top_k is not None: |
| 85 | extra_body["top_k"] = args.top_k |
| 86 | if args.min_p is not None: |
| 87 | extra_body["min_p"] = args.min_p |
| 88 | if args.enable_thinking: |
| 89 | extra_body.setdefault("chat_template_kwargs", {})["enable_thinking"] = True |
| 90 | if args.disable_thinking: |
| 91 | extra_body.setdefault("chat_template_kwargs", {})["enable_thinking"] = False |
| 92 | if extra_body: |
| 93 | query_kwargs["extra_body"] = extra_body |
| 94 | |
| 95 | if args.is_gpt_oss: |
| 96 | query_kwargs["reasoning_effort"] = get_random_reasoning_effort() |
| 97 | return query_kwargs |
| 98 | |
| 99 | |
| 100 | def error_sample(sample, message): |
no test coverage detected