def create_dataset_repo(username, project_name, script_path, token):
    """
    Creates a new dataset repository on Hugging Face and uploads the specified dataset.

    Args:
        username (str): The username of the Hugging Face account.
        project_name (str): The name of the project for which the dataset repository is being created.
        script_path (str): The local path to the dataset folder that needs to be uploaded.
        token (str): The authentication token for the Hugging Face API.

    Returns:
        str: The repository ID of the newly created dataset repository.
    """
    logger.info("Creating dataset repo...")
    api = HfApi(token=token)
    repo_id = f"{username}/autotrain-{project_name}"
    api.create_repo(
        repo_id=repo_id,
        repo_type="dataset",
        private=True,
    )
    logger.info("Uploading dataset...")
    api.upload_folder(
        folder_path=script_path,
        repo_id=repo_id,
        repo_type="dataset",
    )
    logger.info("Dataset uploaded.")
    return repo_id

    Creates a new dataset repository on Hugging Face and uploads the specified dataset.

    Args:
        username (str): The username of the Hugging Face account.
        project_name (str): The name of the project for which the dataset repository is being created.
        script_path (str): The local path to the dataset folder that needs to be uploaded.
        token (str): The authentication token for the Hugging Face API.

    Returns:
        str: The repository ID of the newly created dataset repository.
    
src/autotrain/trainers/generic/utils.py