diff --git a/src/logging/task_tracer.py b/src/logging/task_tracer.py index 6a561fe..f10fc20 100644 --- a/src/logging/task_tracer.py +++ b/src/logging/task_tracer.py @@ -116,7 +116,7 @@ def save(self): try: if not self.log_path.exists(): self.log_path.parent.mkdir(exist_ok=True, parents=True) - with open(self.log_path, mode="w") as dest: + with open(self.log_path, mode="w", encoding='utf8') as dest: dest.write(self.model_dump_json(indent=2)) except Exception as e: logger.error(e, stack_info=True, exc_info=True) diff --git a/utils/prepare_benchmark/main.py b/utils/prepare_benchmark/main.py index 1af6b9f..f6c23bf 100644 --- a/utils/prepare_benchmark/main.py +++ b/utils/prepare_benchmark/main.py @@ -174,7 +174,7 @@ def get(dataset: str): ds_gen = _prepare_dataset(env, dataset) _prepare_filesystem(env) ds_file = env.data_dir / dataset / env.meta_filename - with open(ds_file, mode="w") as f: + with open(ds_file, mode="w", encoding='utf8') as f: for task in ds_gen(): f.write(task.to_json().decode() + "\n") print("\n" + "=" * 80)