Update loader.py

This commit is contained in:
hoshi-hiyouga 2024-05-30 00:20:20 +08:00 committed by GitHub
parent f9a88b89ca
commit ca5dd7c6c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -115,6 +115,7 @@ def load_single_dataset(
expand_indexes = np.random.choice(len(dataset), target_num)
indexes = np.concatenate((indexes, expand_indexes), axis=0)
assert len(indexes) == dataset_attr.num_samples, "Sample num mismatched."
dataset = dataset.select(indexes)
logger.info("Sampled {} examples from dataset {}.".format(dataset_attr.num_samples, dataset_attr))