stas commited on
Commit
f7a8f5c
1 Parent(s): e45ebf9
Files changed (1) hide show
  1. wmt14-en-de-pre-processed.py +2 -2
wmt14-en-de-pre-processed.py CHANGED
@@ -114,9 +114,9 @@ class Wmt14EnDePreProcessed(datasets.GeneratorBasedBuilder):
114
  def _generate_examples(self, source_file, target_file):
115
  """This function returns the examples in the raw (text) form."""
116
  with open(source_file, mode="rb") as f:
117
- source_sentences = f.read().split("\n")
118
  with open(target_file, mode="rb") as f:
119
- target_sentences = f.read().split("\n")
120
 
121
  assert len(target_sentences) == len(source_sentences), "Sizes do not match: %d vs %d for %s vs %s." % (
122
  len(source_sentences),
 
114
  def _generate_examples(self, source_file, target_file):
115
  """This function returns the examples in the raw (text) form."""
116
  with open(source_file, mode="rb") as f:
117
+ source_sentences = f.read().decode("utf8").split("\n")
118
  with open(target_file, mode="rb") as f:
119
+ target_sentences = f.read().decode("utf8").split("\n")
120
 
121
  assert len(target_sentences) == len(source_sentences), "Sizes do not match: %d vs %d for %s vs %s." % (
122
  len(source_sentences),