`huggingface_hub.upload_file` returns a 404 error
Good day,I am trying to upload files to a HF dataset programmatically. The sequence of my actions is as follows:huggingface_hub.create_repo(
        name=dataset_slug,
        private=True,
        repo_type="dataset"
)

huggingface_hub.upload_file(
            path_or_fileobj="{LOCAL_DIRECTORY}/README.md",
            path_in_repo="README.md",
            repo_id="{USERNAME}/" + dataset_slug
)The second command fails with:requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/{USERNAME}/{DATASET_SLUG}/upload/main/README.mdUSERNAME, LOCAL_DIRECTORY, and DATASET_SLUG are replaced appropriately. Am I doing something wrong, or is it a bug on HuggingFace’s end?
2022-03-24T08:44:37Z
Hi there!upload_filealso has a parameter which isrepo_type. You should set it to “dataset” as well for this to work.