in ultravox/tools/ds_tool/ds_tool.py [0:0]
def get_id(sample):
for key in ["id", "segment_id"]:
if key in sample and isinstance(sample[key], str):
return str(sample[key])
for key in ["file", "path", "audio_file"]:
if key in sample and isinstance(sample[key], str):
return Path(sample[key]).stem
raise ValueError("Could not find an ID in the sample")