Skip to content

Commit ca1c7c4

Browse files
Benny ChenBenny Chen
authored andcommitted
fix more errors
1 parent 365545c commit ca1c7c4

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

eval_protocol/benchmarks/test_livebench_data_analysis.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def _read_jsonl_table_from_text(text: str, header_cols: List[str]):
258258

259259
reader = _read_df_v1 if version == "v1" else _read_df_v2
260260
gt_df = reader(output_fmt, ground_truth)
261+
assert gt_df is not None, "GT dataframe is None"
261262

262263
llm_clean = _clean_llm_output(llm_answer)
263264
llm_clean = _remove_initial_phrase(llm_clean)

eval_protocol/benchmarks/test_tau_bench_airline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def test_tau_bench_airline_evaluation(row: EvaluationRow) -> EvaluationRow:
198198
task = Task(
199199
id="Filler", evaluation_criteria=evaluation_criteria, user_scenario=UserScenario(instructions="Filler")
200200
) # id and user_scenario are required for the Task type but not used in calculating reward
201+
assert task.evaluation_criteria is not None, "Task evaluation criteria is None"
201202

202203
if RewardType.DB in task.evaluation_criteria.reward_basis:
203204
env_reward_info = EnvironmentEvaluator.calculate_reward(

eval_protocol/execution/pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ async def _execute_standard_generation(
212212
if system_prompt_content:
213213
current_messages_for_rollout.append({"role": "system", "content": system_prompt_content})
214214
current_messages_for_rollout.append({"role": "user", "content": user_query})
215+
assert self.model_client is not None, "at this point model client needs to be initialized"
215216

216217
generation_output_std = await self.model_client.generate(
217218
messages=current_messages_for_rollout,

eval_protocol/rewards/apps_testing_util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ def run_test(in_outs, test=None, debug=False, timeout=15):
174174
if isinstance(last_block, ast.If):
175175
condition = last_block.test
176176
if ast.unparse(condition).strip() == "__name__ == '__main__'":
177-
test = ast.unparse(astree.body[:-1]) + "\n" + ast.unparse(last_block.body)
177+
# Build modules for unparse to avoid passing lists to ast.unparse
178+
prefix_module = ast.Module(body=astree.body[:-1], type_ignores=[])
179+
body_module = ast.Module(body=last_block.body, type_ignores=[])
180+
test = ast.unparse(prefix_module) + "\n" + ast.unparse(body_module)
178181
except Exception:
179182
pass
180183

0 commit comments

Comments
 (0)