[Python] I'm getting an error when trying to load a Hugging Face dataset in Colab

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    from transformers import pipeline
    from datasets import load_dataset

    # 1. Load the summarization pipeline
    print("Loading summarization pipeline...")
    summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
    print("Pipeline loaded. ✅")

    # 2. Load a sample email from working Enron dataset
    print("Loading a sample email...")
    dataset = load_dataset("ccdv/enron", split="train")
    sample_email = dataset[0] # Use first email


    This is the code I have used and below is the error The dataset also available in the hugging face. I have copied the provided link in the hugging face and still give the error. I need to used pretrained modal for email summarization and apart from this do you have any suggestion?

    FileNotFoundError Traceback (most recent call last)
    /tmp/ipython-input-18-2456496870.py in <cell line: 0>()
    9 # 2. Load a sample email from working Enron dataset
    10 print("Loading a sample email...")
    ---> 11 dataset = load_dataset("ccdv/enron", split="train")
    12 sample_email = dataset[0] # Use first email
    13

    2 frames
    /usr/local/lib/python3.11/dist-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
    2110
    2111 # Create a dataset builder
    -> 2112 builder_instance = load_dataset_builder(
    2113 path=path,
    2114 name=name,

    /usr/local/lib/python3.11/dist-packages/datasets/load.py in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
    1796 download_config = download_config.copy() if download_config else DownloadConfig()
    1797 download_config.storage_options.update(storage_options)
    -> 1798 dataset_module = dataset_module_factory(
    1799 path,
    1800 revision=revision,

    /usr/local/lib/python3.11/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
    1489 raise e1 from None
    1490 if isinstance(e1, FileNotFoundError):
    -> 1491 raise FileNotFoundError(
    1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
    1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"

    FileNotFoundError: Couldn't find a dataset script at /content/ccdv/enron/enron.py or any data file in the same directory. Couldn't find 'ccdv/enron' on the Hugging Face Hub either: FileNotFoundError: Dataset 'ccdv/enron' doesn't exist on the Hub

    Continue reading...

Compartilhe esta Página