MCPcopy Create free account
hub / github.com/allenai/OLMoASR / __len__

Method __len__

scripts/eval/eval.py:1206–1218  ·  view source on GitHub ↗

Return the number of samples in the dataset. Returns: int: Total number of audio samples available for evaluation Note: For HuggingFace datasets, returns the length of the loaded dataset. For custom datasets, returns the length of the audio files

(self)

Source from the content-addressed store, hash-verified

1204 self.transcript_texts = transcript_texts
1205
1206 def __len__(self):
1207 """Return the number of samples in the dataset.
1208
1209 Returns:
1210 int: Total number of audio samples available for evaluation
1211
1212 Note:
1213 For HuggingFace datasets, returns the length of the loaded dataset.
1214 For custom datasets, returns the length of the audio files list.
1215 """
1216 if self.eval_set in HF_DATASETS:
1217 return len(self.dataset)
1218 return len(self.audio_files)
1219
1220 def __getitem__(self, index):
1221 """Get a single sample from the dataset.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected