KeithG33 commited on
Commit
b17bca5
·
1 Parent(s): d153237

change to glob

Browse files
Files changed (1) hide show
  1. ChessBot-Dataset.py +3 -5
ChessBot-Dataset.py CHANGED
@@ -18,19 +18,17 @@ class ChessPGNDataset(GeneratorBasedBuilder):
18
  )
19
 
20
  def _split_generators(self, dl_manager):
21
- import os
22
  # data_dir is the root of your dataset repo
23
  data_dir = self.config.data_dir
24
  return [
25
  SplitGenerator(
26
  name=Split.TRAIN,
27
- gen_kwargs={"shards": [pgn.path for pgn in os.scandir(os.path.join(data_dir,"train")) if pgn.name.endswith(".pgn")]},
28
- # gen_kwargs={"shards": glob.glob(os.path.join(data_dir,"train","*.pgn"))}
29
  ),
30
  SplitGenerator(
31
  name=Split.TEST,
32
- gen_kwargs={"shards": [pgn.path for pgn in os.scandir(os.path.join(data_dir,"test")) if pgn.name.endswith(".pgn")]},
33
- # gen_kwargs={"shards": glob.glob(os.path.join(data_dir,"test","*.pgn"))}
34
  ),
35
  ]
36
 
 
18
  )
19
 
20
  def _split_generators(self, dl_manager):
21
+ import glob
22
  # data_dir is the root of your dataset repo
23
  data_dir = self.config.data_dir
24
  return [
25
  SplitGenerator(
26
  name=Split.TRAIN,
27
+ gen_kwargs={"shards": glob.glob(os.path.join(data_dir,"train","*.pgn"))}
 
28
  ),
29
  SplitGenerator(
30
  name=Split.TEST,
31
+ gen_kwargs={"shards": glob.glob(os.path.join(data_dir,"test","*.pgn"))}
 
32
  ),
33
  ]
34