Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Hugging Face Hub documentation README and Endpoints #527

Merged
merged 7 commits into from
Dec 14, 2021
Merged

Update Hugging Face Hub documentation README and Endpoints #527

merged 7 commits into from
Dec 14, 2021

Conversation

muellerzr
Copy link
Contributor

Started updating the documentation to include the latest API information.

README:

  • Added code formatting to input parameters for consistency
  • Linked to source code directly for cached_download
  • More verbosity with example functionality
  • List out HfApi query methods and link to endpoint documentation

Endpoints:

  • Updated /api/models and /api/datasets to include author filter
  • Added /api/metrics

main:

  • Included a short notice to see more detailed documentation on the huggingface_hub Github, so it is exposed on the HuggingFace Hub documentation webpage
    cc @osanseviero @LysandreJik @julien-c

@LysandreJik
Copy link
Member

Also cc @stevhliu

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR! Overall looks good but left a couple of minor comments

docs/hub/endpoints.md Outdated Show resolved Hide resolved
docs/hub/main.md Outdated Show resolved Hide resolved
src/huggingface_hub/README.md Outdated Show resolved Hide resolved
| /api/datasets/{repo_id} <br/> /api/datasets/{repo_id}/revision/{revision} <br/> GET | Get all information for a specific dataset. <br/>- `full`: Whether to fetch most dataset data, such as all tags, the files, etc. | `dataset_info(repo_id, revision)` | ```headers = { "authorization" : "Bearer $token", "full" : "full" }``` |
| /api/metrics <br/> GET | Get information from all metrics in the Hub. | `list_metrics()` ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we really need this to be honest (no strong opinion), as metrics are not user-generated (unlike models and datasets and spaces) I wouldn't consider them a first class citizen of the hub

(that method is documented in datasets though, where it's relevant to have it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My motivation with exposing it here is since there is a functional api within HfApi for it (e.g. list_metrics), it's in the docs that it doesn't take in params and just grabs them all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julien-c kept it in for final, if we want it removed let me know

docs/hub/endpoints.md Outdated Show resolved Hide resolved
docs/hub/main.md Outdated Show resolved Hide resolved
src/huggingface_hub/README.md Outdated Show resolved Hide resolved
src/huggingface_hub/README.md Outdated Show resolved Hide resolved
src/huggingface_hub/README.md Outdated Show resolved Hide resolved
Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating! I just had a question about adding some more guidance around the parameters and using consistent terms.

docs/hub/endpoints.md Outdated Show resolved Hide resolved
src/huggingface_hub/README.md Outdated Show resolved Hide resolved
src/huggingface_hub/README.md Outdated Show resolved Hide resolved
muellerzr and others added 3 commits December 9, 2021 13:55
Co-authored-by: Omar Sanseviero <osanseviero@users.noreply.github.com>
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks @muellerzr!

LGTM!

@LysandreJik
Copy link
Member

Feel free to merge when the code quality passes :)

@muellerzr muellerzr merged commit ad23977 into huggingface:main Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants