Skip to content

Commit

Permalink
Update the documentation of add_collection_item (#1958)
Browse files Browse the repository at this point in the history
Based on feedback from @justalphie
  • Loading branch information
FremyCompany authored Jan 5, 2024
1 parent a331e82 commit ee1bdc1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/huggingface_hub/hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7633,6 +7633,15 @@ def add_collection_item(
Returns: [`Collection`]
Raises:
`HTTPError`:
HTTP 403 if you only have read-only access to the repo. This can be the case if you don't have `write`
or `admin` role in the organization the repo belongs to or if you passed a `read` token.
`HTTPError`:
HTTP 404 if the item you try to add to the collection does not exist on the Hub.
`HTTPError`:
HTTP 409 if the item you try to add to the collection is already in the collection (and exists_ok=False)
Example:
```py
Expand Down

0 comments on commit ee1bdc1

Please sign in to comment.