From 2a1bcc1c7d28e1784fafc32fc5c2c5440d718181 Mon Sep 17 00:00:00 2001 From: didi <84363704+didiforgithub@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:38:46 +0800 Subject: [PATCH] Fix pre-commit --- examples/ags/benchmark/humaneval.py | 2 +- metagpt/utils/common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ags/benchmark/humaneval.py b/examples/ags/benchmark/humaneval.py index 62b062ae0..ec1a3402d 100644 --- a/examples/ags/benchmark/humaneval.py +++ b/examples/ags/benchmark/humaneval.py @@ -74,7 +74,7 @@ async def samples_generate(mode: ModeType, result_path: str = "samples.jsonl"): async def solve_and_write(id: str, mode: ModeType) -> Optional[str]: try: sample_dict = await route_generate(mode, id) - except Exception as e: + except Exception: return id async with file_lock: async with aiofiles.open(result_path, mode="a") as f: diff --git a/metagpt/utils/common.py b/metagpt/utils/common.py index dfb616da4..47f2768cd 100644 --- a/metagpt/utils/common.py +++ b/metagpt/utils/common.py @@ -602,7 +602,7 @@ def add_jsonl_file(jsonl_file: str, data: list[dict], encoding: str = None): with open(jsonl_file, "a", encoding=encoding) as fout: for json_item in data: - fout.write(json.dumps(json_item) + '\n') + fout.write(json.dumps(json_item) + "\n") def read_csv_to_list(curr_file: str, header=False, strip_trail=True):