Skip to content

Commit

Permalink
Specify UTF-8 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
alanakbik committed Feb 3, 2025
1 parent dcd029b commit 4332d79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flair/datasets/sequence_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -5570,9 +5570,9 @@ def __init__(
# Add sentence boundary marker
modified_split_filename = data_path / f"bar-wiki-{split}.tsv"
if not modified_split_filename.is_file():
f_out = open(modified_split_filename, "w")
f_out = open(modified_split_filename, "w", encoding="utf-8")

with open(original_split_filename) as f_p:
with open(original_split_filename, encoding="utf-8") as f_p:
for line in f_p:
line = line.strip()
if line.startswith("# newdoc id = "):
Expand Down

0 comments on commit 4332d79

Please sign in to comment.