From 096d5fd0c3555befe3b3c75d1ebec86abc90f0b1 Mon Sep 17 00:00:00 2001 From: Boris Dayma Date: Wed, 7 Dec 2022 09:35:30 -0600 Subject: [PATCH] fix(wandb): encoding on Windows fix #143 --- openai/wandb_logger.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openai/wandb_logger.py b/openai/wandb_logger.py index bc6696fb39..6dd7614ca2 100644 --- a/openai/wandb_logger.py +++ b/openai/wandb_logger.py @@ -242,7 +242,9 @@ def _log_artifacts(cls, fine_tune, project, entity): type="fine_tune_details", metadata=fine_tune, ) - with artifact.new_file("fine_tune_details.json") as f: + with artifact.new_file( + "fine_tune_details.json", mode="w", encoding="utf-8" + ) as f: json.dump(fine_tune, f, indent=2) wandb.run.log_artifact( artifact, @@ -276,7 +278,7 @@ def _log_artifact_inputs(cls, file, prefix, artifact_type, project, entity): ) return artifact = wandb.Artifact(artifact_name, type=artifact_type, metadata=file) - with artifact.new_file(filename, mode="w") as f: + with artifact.new_file(filename, mode="w", encoding="utf-8") as f: f.write(file_content) # create a Table