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

DEPR deprecate hub_utils.get_model_output #396

Merged
merged 3 commits into from Oct 12, 2023

Conversation

adrinjalali
Copy link
Member

This deprecates the function, to be removed in the next released.

Copy link
Collaborator

@BenjaminBossan BenjaminBossan 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 adding this.

I'm not sure why test_push_download[pickle-False] is failing. At first I thought another rate limit, but I ran the tests a couple of times locally and they passed. Maybe it's a Windows issue.

@@ -512,6 +513,12 @@ def test_inference(
assert np.allclose(output, y_pred)


def test_get_model_output_deprecated():
Copy link
Collaborator

Choose a reason for hiding this comment

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

If, in the test above, you add the match to pytest.warns, this test would be completely redundant, right? This might be a worthwhile change, so that we avoid hitting the endpoint even more often. If you want to leave this as a separate test, it should have the @pytest.mark.network and @pytest.mark.inference decorators markers, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here I'm not passing any token and not passing a valid model name, so the function would fail anyway (hence the pytest.raises(Exception), therefore I don't think it even needs a network marker, and it can be in all situations and not only with a specific commit message or a merker for pytest.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, then it's good.

"This feature is no longer free on hf.co and therefore this function will"
" be removed in the next release. Use `huggingface_hub.InferenceClient`"
" instead.",
FutureWarning,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if DeprecationWarning is more appropriate.

Copy link
Member Author

Choose a reason for hiding this comment

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

DeprecationWarning is not shown by default, but FutureWarning is, that's why in sklearn we switched to FutureWarning to make sure people actually see it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL. Makes sense.

# TODO: the "type: ignore" should eventually become unncessary when hf_hub
# is updated
warnings.warn(
"This feature is no longer free on hf.co and therefore this function will"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically speaking, it's still free, just heavily rate-limited.

Copy link
Member Author

Choose a reason for hiding this comment

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

So it's not free 😁

Copy link
Collaborator

Choose a reason for hiding this comment

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

A philosophical question...

Copy link
Member Author

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

I'm not sure why test_push_download[pickle-False] is failing. At first I thought another rate limit, but I ran the tests a couple of times locally and they passed. Maybe it's a Windows issue.

Can figure that out in another PR probably :)

"This feature is no longer free on hf.co and therefore this function will"
" be removed in the next release. Use `huggingface_hub.InferenceClient`"
" instead.",
FutureWarning,
Copy link
Member Author

Choose a reason for hiding this comment

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

DeprecationWarning is not shown by default, but FutureWarning is, that's why in sklearn we switched to FutureWarning to make sure people actually see it.

@@ -512,6 +513,12 @@ def test_inference(
assert np.allclose(output, y_pred)


def test_get_model_output_deprecated():
Copy link
Member Author

Choose a reason for hiding this comment

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

Here I'm not passing any token and not passing a valid model name, so the function would fail anyway (hence the pytest.raises(Exception), therefore I don't think it even needs a network marker, and it can be in all situations and not only with a specific commit message or a merker for pytest.

# TODO: the "type: ignore" should eventually become unncessary when hf_hub
# is updated
warnings.warn(
"This feature is no longer free on hf.co and therefore this function will"
Copy link
Member Author

Choose a reason for hiding this comment

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

So it's not free 😁

# TODO: the "type: ignore" should eventually become unncessary when hf_hub
# is updated
warnings.warn(
"This feature is no longer free on hf.co and therefore this function will"
Copy link
Collaborator

Choose a reason for hiding this comment

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

A philosophical question...

"This feature is no longer free on hf.co and therefore this function will"
" be removed in the next release. Use `huggingface_hub.InferenceClient`"
" instead.",
FutureWarning,
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL. Makes sense.

@@ -512,6 +513,12 @@ def test_inference(
assert np.allclose(output, y_pred)


def test_get_model_output_deprecated():
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, then it's good.

@adrinjalali
Copy link
Member Author

@BenjaminBossan so should we merge?

@BenjaminBossan BenjaminBossan merged commit 98541de into skops-dev:main Oct 12, 2023
11 of 14 checks passed
@adrinjalali adrinjalali deleted the depr branch October 12, 2023 14:40
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.

None yet

2 participants