Skip to content

Deprecated upload_file command in the NLP course #755

Open
@tinosai

Description

This link details a method to submit files to one's HF repo using the huggingface_hub.upload_file function.

from huggingface_hub import upload_file

upload_file(
    "<path_to_file>/config.json",
    path_in_repo="config.json",
    repo_id="<namespace>/dummy-model",
)

This is however not working as of version 0.26.2. Please replace the code with the newer syntax explained here:

from huggingface_hub import HfApi
api = HfApi()
api.upload_file(
    path_or_fileobj="<path_to_file>/config.json",,
    path_in_repo="config.json",
    repo_id="<namespace>/dummy-model",
)

Thank you!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions