euroeval.custom_dataset_configs¶
source module euroeval.custom_dataset_configs
Load custom dataset configs.
Functions
-
load_custom_datasets_module — Load the custom datasets module if it exists.
-
try_get_dataset_config_from_repo — Try to get a dataset config from a Hugging Face dataset repository.
source load_custom_datasets_module(custom_datasets_file: Path) → ModuleType | None
Load the custom datasets module if it exists.
Parameters
-
custom_datasets_file : Path — The path to the custom datasets module.
Raises
-
RuntimeError — If the custom datasets module cannot be loaded.
source try_get_dataset_config_from_repo(dataset_id: str, api_key: str | None, cache_dir: Path) → DatasetConfig | None
Try to get a dataset config from a Hugging Face dataset repository.
Parameters
-
dataset_id : str — The ID of the dataset to get the config for.
-
api_key : str | None — The Hugging Face API key to use to check if the repositories have custom dataset configs.
-
cache_dir : Path — The directory to store the cache in.
Returns
-
DatasetConfig | None — The dataset config if it exists, otherwise None.