Skip to content

Commit

Permalink
cast np.int32 as int for random.Random arg
Browse files Browse the repository at this point in the history
  • Loading branch information
priyakasimbeg committed Jan 23, 2025
1 parent 9b7cee4 commit 5775ed1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _build_dataset(
}
if split == 'eval_train':
train_indices = indices_split['train']
random.Random(data_rng[0]).shuffle(train_indices)
random.Random(int(data_rng[0])).shuffle(train_indices)
indices_split['eval_train'] = train_indices[:self.num_eval_train_examples]
if split in indices_split:
dataset = torch.utils.data.Subset(dataset, indices_split[split])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _build_dataset(

if split == 'eval_train':
indices = list(range(self.num_train_examples))
random.Random(data_rng[0]).shuffle(indices)
random.Random(int(data_rng[0])).shuffle(indices)
dataset = torch.utils.data.Subset(dataset,
indices[:self.num_eval_train_examples])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _build_input_queue(
ds = LibriSpeechDataset(split=ds_split, data_dir=data_dir)
if split == 'eval_train':
indices = list(range(len(ds)))
random.Random(data_rng[0]).shuffle(indices)
random.Random(int(data_rng[0])).shuffle(indices)
ds = torch.utils.data.Subset(ds, indices[:self.num_eval_train_examples])

sampler = None
Expand Down

0 comments on commit 5775ed1

Please sign in to comment.