Skip to content

Commit af59037

Browse files
authored
fix(wandb): encoding on Windows (#148)
fix #143
1 parent 3c00e85 commit af59037

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: openai/wandb_logger.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ def _log_artifacts(cls, fine_tune, project, entity):
242242
type="fine_tune_details",
243243
metadata=fine_tune,
244244
)
245-
with artifact.new_file("fine_tune_details.json") as f:
245+
with artifact.new_file(
246+
"fine_tune_details.json", mode="w", encoding="utf-8"
247+
) as f:
246248
json.dump(fine_tune, f, indent=2)
247249
wandb.run.log_artifact(
248250
artifact,
@@ -276,7 +278,7 @@ def _log_artifact_inputs(cls, file, prefix, artifact_type, project, entity):
276278
)
277279
return
278280
artifact = wandb.Artifact(artifact_name, type=artifact_type, metadata=file)
279-
with artifact.new_file(filename, mode="w") as f:
281+
with artifact.new_file(filename, mode="w", encoding="utf-8") as f:
280282
f.write(file_content)
281283

282284
# create a Table

0 commit comments

Comments
 (0)