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

Adding InferenceClient.get_recommended_model #1770

Merged
merged 9 commits into from
Oct 23, 2023
Merged

Adding InferenceClient.get_recommended_model #1770

merged 9 commits into from
Oct 23, 2023

Conversation

jamesbraza
Copy link
Contributor

Closes #1767

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 20, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@Wauplin Wauplin 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 the quick PR @jamesbraza! I've added some minor comments but overall looks good :)

src/huggingface_hub/inference/_client.py Show resolved Hide resolved
src/huggingface_hub/inference/_client.py Outdated Show resolved Hide resolved
src/huggingface_hub/inference/_client.py Outdated Show resolved Hide resolved
@jamesbraza jamesbraza requested a review from Wauplin October 20, 2023 18:05
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (3a99199) 82.60% compared to head (988c513) 82.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1770      +/-   ##
==========================================
- Coverage   82.60%   82.17%   -0.44%     
==========================================
  Files          62       62              
  Lines        7302     7310       +8     
==========================================
- Hits         6032     6007      -25     
- Misses       1270     1303      +33     
Files Coverage Δ
src/huggingface_hub/inference/_client.py 81.98% <100.00%> (+0.47%) ⬆️
src/huggingface_hub/inference/_common.py 90.98% <ø> (-0.43%) ⬇️
...gingface_hub/inference/_generated/_async_client.py 60.95% <87.50%> (+0.60%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for making the changes @jamesbraza !

@Wauplin Wauplin merged commit d66475e into huggingface:main Oct 23, 2023
@jamesbraza jamesbraza deleted the recommended-model branch October 23, 2023 15:41
Wauplin added a commit that referenced this pull request Oct 26, 2023
* removed tags from endpoint tests

* removed tags from endpoints

* removed tags from hf_api

* removed tags from docstrings in endpoint_helpers

* removed tags from hf_api

* removed model search argument from test_hf_api

* removed ModelSearchArguments and DataSearchArguments

* removed DatasetSearchArguments and ModelSearchArguments

* removed DatasetSearchArguments and

* removed ModelSearchArguments and DatasetSearchArguments from the docs

* Revert "removed DatasetSearchArguments and"

This reverts commit ce6b91b.

* removed tags from __init__.py

* ran make style

* Removed ## How to explore filter options ? section

* Revert "removed tags from __init__.py"

This reverts commit ad1a31c.

Reverting removal get_dataset_tags and get_model_tags for comment 2

* Revert "removed DatasetSearchArguments and ModelSearchArguments"

This reverts commit fbf6dd0.

* Revert "removed tags from __init__.py"

This reverts commit ad1a31c.

* Revert "removed tags from hf_api"

This reverts commit 2cefee1.

* Revert "removed tags from hf_api"

This reverts commit dd3b8f1.

* Removed attribute dictionary from imports
and removed model search argument class

* Complete removed class AttributeDictionary(dict):

* Removed attribute dictionary tests

* Updating ModelTags and DatasetTags
so that they just return the raw dictionary

* Removed final DatasetTags import

* Removed 'ModelTags' import

* Ran make style

* fix: remove useless token (#1765)

* Retry on ConnectionError/ReadTimeout when streaming file from server (#1766)

* Retry on ConnectionError/ReadTimeout when streaming file from server

* add test

* fix testing utils

* Adding `InferenceClient.get_recommended_model` (#1770)

* Moved logger info to InferenceClient, so get_recommended_model function can bypass that

* Added get_recommended_model to InferenceClient

* Ran make style to generate the async client

* Added tests of get_recommended_model

* Update src/huggingface_hub/inference/_client.py

Co-authored-by: Lucain <[email protected]>

* Fixed ordering of logger info and _get_recommended_model, for model string to have been populated

* Removed _get_recommended_model private function, in favor of get_recommended_model in InferenceClient

* Fixed wording of ValueError to use 'model' not 'task'

* Ran make style for AsyncInferenceClient

---------

Co-authored-by: Lucain <[email protected]>

* Fix document link for manage-cache (#1774)

* Fix document link for manage-cache

* Use redirects in _redirects.yml

* Update docs/source/en/package_reference/file_download.md

---------

Co-authored-by: Lucain <[email protected]>

* Minor doc fixes (#1775)

* Don't use `api` in `list_repo_refs` example.

* Minor typo fssepc -> fsspec

* Use `.item_object_id` instead of `._id`

* Ran make style

---------

Co-authored-by: Remy <[email protected]>
Co-authored-by: Lucain <[email protected]>
Co-authored-by: James Braza <[email protected]>
Co-authored-by: liuxueyang <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
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.

Request: discerning what the default model is when using InferenceClient without a model
3 participants