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