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.md
USERNAME, LOCAL_DIRECTORY, and DATASET_SLUG are replaced appropriately. Am I doing something wrong, or is it a bug on HuggingFace’s end?