Skip to content

Commit

Permalink
[BUGFIX] Guard against UnicodeEncodeError when saving validation resu…
Browse files Browse the repository at this point in the history
…lts in Google Colab environment (ludwig-ai#3875)
  • Loading branch information
alexsherstinsky authored Jan 10, 2024
1 parent b6b1f70 commit c3bc33e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ludwig/trainers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def run_evaluation(
os.makedirs(dict_save_dir, exist_ok=True)
dict_save_path = os.path.join(dict_save_dir, f"{progress_tracker.checkpoint_number}.csv")
llm_eval_examples = pd.DataFrame(llm_eval_examples).to_dict(orient="records")
with open(dict_save_path, "w") as outfile:
with open(dict_save_path, "w", encoding="utf-8") as outfile:
writer = csv.DictWriter(outfile, fieldnames=["inputs", "targets", "outputs"])
writer.writeheader()
writer.writerows(llm_eval_examples)
Expand Down

0 comments on commit c3bc33e

Please sign in to comment.