Skip to content

Commit d2cacb7

Browse files
authored
Update eval_instruct.py (#126)
* Update eval_instruct.py Fix missing comma * Update eval_instruct.py * Update eval_instruct.py
1 parent 522f1f4 commit d2cacb7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

eval/chat_benchmarks/MTBench/eval_instruct.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
config: Optional[MTBenchConfig] = None,
7272
debug: bool = False,
7373
annotator_model: str = "gpt-4o-mini-2024-07-18",
74-
max_tokens: Optional[int] = 1024
74+
max_tokens: Optional[int] = 1024,
7575
logger: Optional[logging.Logger] = None,
7676
system_instruction: Optional[str] = None,
7777
):
@@ -87,13 +87,13 @@ def __init__(
8787
"""
8888
super().__init__(logger=logger, system_instruction=system_instruction)
8989
self.base_path = Path(base_path)
90+
if getattr(self, "config", None) is None:
91+
self.config = MTBenchConfig(
92+
judge_model=annotator_model,
93+
)
94+
else:
95+
self.config = config
9096
self.config.max_new_token = max_tokens if max_tokens is not None else 1024
91-
if annotator_model == "auto":
92-
annotator_model = "gpt-4"
93-
if config:
94-
print(f"Warning: Overwriting config.judge_model = {annotator_model} ")
95-
config.judge_model = annotator_model
96-
self.config = config or MTBenchConfig(judge_model=annotator_model)
9797
self.debug = debug
9898

9999
# Setup paths
@@ -116,7 +116,6 @@ def get_model_answers(self, model: LM, model_id: str, questions: List[Dict[str,
116116
max_turns = max(len(q["turns"]) for q in questions)
117117
answer_file = self.answer_dir / f"{model_id}.jsonl"
118118

119-
self.config.max_new_token = self.max_new_token
120119
# Process each turn
121120
for turn_num in range(max_turns):
122121
self.logger.info(f"Processing Turn {turn_num + 1}")

0 commit comments

Comments
 (0)