KeithG33 commited on
Commit
071cd23
·
1 Parent(s): 3002283

readmeconfig

Browse files
Files changed (1) hide show
  1. ChessBot-Dataset.py +22 -22
ChessBot-Dataset.py CHANGED
@@ -24,7 +24,7 @@ class ChessPGNDataset(GeneratorBasedBuilder):
24
  BUILDER_CONFIGS = [
25
  ChessPGNConfig(
26
  name="default",
27
- version=Version("0.0.1"),
28
  description="Chess positions + moves + results, streamed from PGN shards",
29
  data_files={
30
  "train": "train/*.pgn",
@@ -43,32 +43,32 @@ class ChessPGNDataset(GeneratorBasedBuilder):
43
  })
44
  )
45
 
46
- def _split_generators(self, dl_manager: DownloadManager):
47
- from pathlib import Path, os
48
 
49
- if self.config.data_dir:
50
- repo_root = Path(self.config.data_dir)
51
- train_files = [repo_root / 'train' / f for f in os.listdir(repo_root / 'train')]
52
- test_files = [repo_root / 'test' / f for f in os.listdir(repo_root / 'test')]
53
 
54
- elif self.config.data_files:
55
- train_files = self.config.data_files["train"]
56
- test_files = self.config.data_files["test"]
57
 
58
 
59
- train_paths = dl_manager.download(train_files)
60
- test_paths = dl_manager.download(test_files)
61
 
62
- return [
63
- SplitGenerator(
64
- name=Split.TRAIN,
65
- gen_kwargs={"shards": train_paths},
66
- ),
67
- SplitGenerator(
68
- name=Split.TEST,
69
- gen_kwargs={"shards": test_paths},
70
- ),
71
- ]
72
 
73
  def _generate_examples(self, shards):
74
  import chess.pgn
 
24
  BUILDER_CONFIGS = [
25
  ChessPGNConfig(
26
  name="default",
27
+ version=Version("0.0.2"),
28
  description="Chess positions + moves + results, streamed from PGN shards",
29
  data_files={
30
  "train": "train/*.pgn",
 
43
  })
44
  )
45
 
46
+ # def _split_generators(self, dl_manager: DownloadManager):
47
+ # from pathlib import Path, os
48
 
49
+ # if self.config.data_dir:
50
+ # repo_root = Path(self.config.data_dir)
51
+ # train_files = [repo_root / 'train' / f for f in os.listdir(repo_root / 'train')]
52
+ # test_files = [repo_root / 'test' / f for f in os.listdir(repo_root / 'test')]
53
 
54
+ # elif self.config.data_files:
55
+ # train_files = self.config.data_files["train"]
56
+ # test_files = self.config.data_files["test"]
57
 
58
 
59
+ # train_paths = dl_manager.download(train_files)
60
+ # test_paths = dl_manager.download(test_files)
61
 
62
+ # return [
63
+ # SplitGenerator(
64
+ # name=Split.TRAIN,
65
+ # gen_kwargs={"shards": train_paths},
66
+ # ),
67
+ # SplitGenerator(
68
+ # name=Split.TEST,
69
+ # gen_kwargs={"shards": test_paths},
70
+ # ),
71
+ # ]
72
 
73
  def _generate_examples(self, shards):
74
  import chess.pgn