Skip to content

Commit

Permalink
fix(wandb): encoding on Windows (#148)
Browse files Browse the repository at this point in the history
fix #143
  • Loading branch information
borisdayma authored Dec 7, 2022
1 parent 3c00e85 commit af59037
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openai/wandb_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit af59037

Please sign in to comment.