Exemplo n.º 1
0
def get_dataset_names():
    if is_local_mode() is True:
        # fetch all dirs in "./datasets/"
        datasets = [dataset_dir.split("/")[-2] for dataset_dir in glob.glob("./datasets/*/")]
    else:
        # fetch all dataset names
        api = hf_api.HfApi()
        datasets = [x.datasetId for x in api.dataset_list()]

    dataset_names_parametrized = [{"testcase_name": x, "dataset_name": x} for x in datasets]
    return dataset_names_parametrized
Exemplo n.º 2
0
def get_dataset_names():
    datasets = []
    if is_local_mode() is True or isinstance(is_local_mode(),
                                             int) and is_local_mode() > 0:
        # fetch all dirs in "./datasets/"
        datasets = datasets + [
            dataset_dir.split("/")[-2]
            for dataset_dir in glob.glob("./datasets/*/")
        ]
    if is_aws_mode() is True or isinstance(is_aws_mode(),
                                           int) and is_aws_mode() > 0:
        api = hf_api.HfApi()
        # fetch all dataset names
        datasets = datasets + [x.id for x in api.dataset_list()]

    dataset_names_parametrized = [{
        "testcase_name": x,
        "dataset_name": x
    } for x in set(datasets)]
    return dataset_names_parametrized
Exemplo n.º 3
0
def get_aws_dataset_names():
    api = hf_api.HfApi()
    # fetch all dataset names
    datasets = [x.id for x in api.dataset_list(with_community_datasets=False)]
    return [{"testcase_name": x, "dataset_name": x} for x in datasets]
Exemplo n.º 4
0
def get_aws_dataset_names():
    api = hf_api.HfApi()
    # fetch all dataset names
    datasets = api.dataset_list(with_community_datasets=False, id_only=True)
    return [{"testcase_name": x, "dataset_name": x} for x in datasets]
Exemplo n.º 5
0
def get_aws_metric_names():
    api = hf_api.HfApi()
    # fetch all metric names
    metrics = [x.id for x in api.metric_list()]
    return [{"testcase_name": x, "metric_name": x} for x in metrics]