Datasets:

ArXiv:
ShivamPR21 commited on
Commit
318e103
1 Parent(s): 740964d

Fraction error fixed.

Browse files

Signed-off-by: ShivamPR21 <pandeyshivam2023robotics@gmail.com>

Files changed (1) hide show
  1. RedPajama-Data-V2.py +1 -1
RedPajama-Data-V2.py CHANGED
@@ -249,7 +249,7 @@ class RedPajamaV2(datasets.GeneratorBasedBuilder):
249
  if self.config.name == 'random-sample':
250
  seed = 42 + i_lang * len(_LANGUAGES) + i_snapshot * len(_CC_SNAPSHOT_IDS) + i_part * 3
251
  np.random.seed(seed)
252
- loc_shards = np.random.choice(shards, size=len(shards)*shards_fraction, replace=False)
253
 
254
  for n in loc_shards:
255
  base_tag = f"{snapshot}/{n:04d}/{lang}_{part}"
 
249
  if self.config.name == 'random-sample':
250
  seed = 42 + i_lang * len(_LANGUAGES) + i_snapshot * len(_CC_SNAPSHOT_IDS) + i_part * 3
251
  np.random.seed(seed)
252
+ loc_shards = np.random.choice(shards, size=max(1, int(len(shards)*shards_fraction)), replace=False)
253
 
254
  for n in loc_shards:
255
  base_tag = f"{snapshot}/{n:04d}/{lang}_{part}"