albertvillanova HF staff DevWorld commited on
Commit
fa44f1d
1 Parent(s): a5d0d35

Fix DirEntry path (#1)

Browse files

- Absolute path (bdda0e10e355cede9fa9db3e4f27883057c9c21c)
- Use DirEntry.path attribute (8d938328e64b5a0267941939cff70a8824e43bdc)


Co-authored-by: World <DevWorld@users.noreply.huggingface.co>

Files changed (1) hide show
  1. squad_kor_v2.py +1 -1
squad_kor_v2.py CHANGED
@@ -117,7 +117,7 @@ class SquadKorV2(datasets.GeneratorBasedBuilder):
117
  for d in dirs:
118
  filepaths = sorted(os.scandir(d), key=lambda x: x.name)
119
  for filepath in filepaths:
120
- with open(filepath, encoding="utf-8") as f:
121
  squad = json.load(f)
122
  for example in squad["data"]:
123
  title = example.get("title", "").strip()
 
117
  for d in dirs:
118
  filepaths = sorted(os.scandir(d), key=lambda x: x.name)
119
  for filepath in filepaths:
120
+ with open(filepath.path, encoding="utf-8") as f:
121
  squad = json.load(f)
122
  for example in squad["data"]:
123
  title = example.get("title", "").strip()