Fix RuntimeError: Sharding is ambiguous for this dataset
#4
by albertvillanova HF Staff - opened
395 unmodified lines3963973983994004014022 unmodified lines4054064074084094104112 unmodified lines41441541641741841942080 unmodified lines501502503504505506507395 unmodified linesgen_kwargs={"annotation_path": annotation_path,"samples_paths": train_path,"ids": _TRAIN_SAMPLE_IDS,"verification_ids": train_ids,},),2 unmodified linesgen_kwargs={"annotation_path": annotation_path,"samples_paths": validation_path,"ids": _VALIDATION_SAMPLE_IDS,"verification_ids": validation_ids,},),2 unmodified linesgen_kwargs={"annotation_path": annotation_path,"samples_paths": eval_path,"ids": _EVAL_SAMPLE_IDS,"verification_ids": eval_ids,},),80 unmodified linessample_paths = samples_paths[num_audios * i : num_audios * (i + 1)]sample_verification_id = set(verification_ids[num_audios * i : num_audios * (i + 1)])# make sure that multi microphone samples are correctly atttributed to labelsif len(sample_verification_id) > 1 or next(iter(sample_verification_id)) != _id:raise ValueError(f"Incorrect dataset generation. The files {sample_paths} of id {_id} have incorrect verification_ids {sample_verification_id}."395 unmodified lines3963973983994004014022 unmodified lines4054064074084094104112 unmodified lines41441541641741841942080 unmodified lines501502503504505506507395 unmodified linesgen_kwargs={"annotation_path": annotation_path,"samples_paths": train_path,"ids": tuple(_TRAIN_SAMPLE_IDS),"verification_ids": train_ids,},),2 unmodified linesgen_kwargs={"annotation_path": annotation_path,"samples_paths": validation_path,"ids": tuple(_VALIDATION_SAMPLE_IDS),"verification_ids": validation_ids,},),2 unmodified linesgen_kwargs={"annotation_path": annotation_path,"samples_paths": eval_path,"ids": tuple(_EVAL_SAMPLE_IDS),"verification_ids": eval_ids,},),80 unmodified linessample_paths = samples_paths[num_audios * i : num_audios * (i + 1)]sample_verification_id = set(verification_ids[num_audios * i : num_audios * (i + 1)])# make sure that multi microphone samples are correctly attributed to labelsif len(sample_verification_id) > 1 or next(iter(sample_verification_id)) != _id:raise ValueError(f"Incorrect dataset generation. The files {sample_paths} of id {_id} have incorrect verification_ids {sample_verification_id}."
ami.py+4-4