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

Method __init__

scripts/eval/eval.py:1031–1096  ·  view source on GitHub ↗

Initialize the evaluation dataset. Sets up the appropriate dataset loader based on the evaluation set and task type. Handles both HuggingFace datasets and custom dataset loaders with automatic data downloading if needed. Args: task (Literal): Type of tra

(
        self,
        task: Literal["eng_transcribe", "long_form_transcribe"],
        eval_set: Literal[
            "librispeech_clean",
            "librispeech_other",
            "tedlium",
            "wsj",
            "callhome",
            "switchboard",
            "common_voice",
            "artie_bias_corpus",
            "coraal",
            "chime6",
            "ami_ihm",
            "ami_sdm",
            "voxpopuli",
            "fleurs",
            "meanwhile",
            "kincaid46",
            "rev16",
            "earnings21",
            "earnings22",
        ],
        hf_token: Optional[str] = None,
        eval_dir: str = "data/eval",
        n_mels: int = DEFAULT_N_MELS,
    )

Source from the content-addressed store, hash-verified

1029 """
1030
1031 def __init__(
1032 self,
1033 task: Literal["eng_transcribe", "long_form_transcribe"],
1034 eval_set: Literal[
1035 "librispeech_clean",
1036 "librispeech_other",
1037 "tedlium",
1038 "wsj",
1039 "callhome",
1040 "switchboard",
1041 "common_voice",
1042 "artie_bias_corpus",
1043 "coraal",
1044 "chime6",
1045 "ami_ihm",
1046 "ami_sdm",
1047 "voxpopuli",
1048 "fleurs",
1049 "meanwhile",
1050 "kincaid46",
1051 "rev16",
1052 "earnings21",
1053 "earnings22",
1054 ],
1055 hf_token: Optional[str] = None,
1056 eval_dir: str = "data/eval",
1057 n_mels: int = DEFAULT_N_MELS,
1058 ):
1059 """Initialize the evaluation dataset.
1060
1061 Sets up the appropriate dataset loader based on the evaluation set and task type.
1062 Handles both HuggingFace datasets and custom dataset loaders with automatic
1063 data downloading if needed.
1064
1065 Args:
1066 task (Literal): Type of transcription task - either "eng_transcribe" for
1067 short-form or "long_form_transcribe" for extended audio
1068 eval_set (Literal): Name of the evaluation dataset to load
1069 hf_token (Optional[str], optional): HuggingFace authentication token for
1070 private datasets. Defaults to None.
1071 eval_dir (str, optional): Directory for storing evaluation datasets.
1072 Defaults to "data/eval".
1073 n_mels (int, optional): Number of mel-spectrogram bins for short-form tasks.
1074 Defaults to DEFAULT_N_MELS.
1075
1076 Raises:
1077 ValueError: If eval_set is not supported for the specified task
1078 FileNotFoundError: If required dataset files are not found and cannot be downloaded
1079
1080 Example:
1081 >>> dataset = EvalDataset(
1082 ... task="eng_transcribe",
1083 ... eval_set="librispeech_clean",
1084 ... eval_dir="/data/eval",
1085 ... n_mels=80
1086 ... )
1087 """
1088 self.eval_set = eval_set

Callers

nothing calls this directly

Calls 3

_init_hf_datasetMethod · 0.95
_init_custom_datasetMethod · 0.95
AudioProcessorClass · 0.85

Tested by

no test coverage detected