Leyo commited on
Commit
9f4c747
·
1 Parent(s): 5e91d88

fixed txt reading

Browse files
Files changed (1) hide show
  1. TGIF.py +2 -2
TGIF.py CHANGED
@@ -93,9 +93,9 @@ class TGIF(datasets.GeneratorBasedBuilder):
93
  dict = {}
94
  for path, f in files:
95
  if path.endswith(split + ".txt"):
96
- txt_file = f.readlines()
97
  for line in txt_file:
98
- line = line[0:-1]
99
  dict[line] = []
100
  for path, f in files:
101
  if path.endswith("tgif-v1.0.tsv"):
 
93
  dict = {}
94
  for path, f in files:
95
  if path.endswith(split + ".txt"):
96
+ txt_file = f.read().decode("utf-8").split("\n")
97
  for line in txt_file:
98
+ line = line
99
  dict[line] = []
100
  for path, f in files:
101
  if path.endswith("tgif-v1.0.tsv"):