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

MNT Move to huggingface_hub v0.10 #162

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

BenjaminBossan
Copy link
Collaborator

Resolves #155

There are two major changes accompanying this move:

  • Model cards have now moved to the hub libary, modelcards is deprecated
  • Some API changes around token => use_auth_token

Some docstrings were fixed too.

Comment: Took me several tries to get the token => use_auth_token transition right, as it's hard to guess what method uses what, and the use of **kwargs by some methods is not helping.

Resolves skops-dev#155

There are two major changes accompanying this move:

- Model cards have now moved to the hub libary, modelcards is deprecated
- Some API changes around token => use_auth_token
@BenjaminBossan
Copy link
Collaborator Author

Hmm, CI is failing on Windows with encoding errors for model cards. I wonder if that is caused by something getting lost on the move to HF hub. E.g. here, the encoding used to be indicated explicitly:

https://github.com/nateraw/modelcards/blob/119c895eaf97554e82f6cd73d4fd0e9aa289c3c7/modelcards/cards.py#L82
https://github.com/nateraw/modelcards/blob/119c895eaf97554e82f6cd73d4fd0e9aa289c3c7/modelcards/cards.py#L115

The save and load methods of RepoCard in the hub library don't do that anymore.

Ping @nateraw @merveenoyan

@nateraw
Copy link
Contributor

nateraw commented Oct 3, 2022

What's the solution here? Should I update the encoding in huggingface_hub, then we leave this failing on windows for now until next minor release or something? Best solution would probably be to make that update and do quick patch release then use that patch release here, I guess.

Would be really nice if we had windows tests there too but guessing that's a rather large undertaking.

CC @Wauplin - wdyt?

@adrinjalali
Copy link
Member

We rather wait till the issue is fixed and release (in a minor match maybe) on the huggingface_hub side. Rather not break windows users.

BenjaminBossan added a commit to BenjaminBossan/skops that referenced this pull request Oct 4, 2022
That restriction was a short term solution because we thought we could
make v0.10 work with a few changes. However, that's not the case because
of a bug in HF hub model cards on Windows. This requires a bugfix
release before it would be fixed.

In the meantime, we should allow users to install v0.10, since there is
no technical reason not to use it. The only annoyance is that users will
get FutureWarnings.

For CI, we filter out corresponding FutureWarnings for the time being.
Once the HF hub bug is fixed, we can proceed with skops-dev#162 and remove the
filter.
@Wauplin
Copy link

Wauplin commented Oct 10, 2022

Hi there 👋 Thanks for reporting this. I created a PR to fix this (huggingface/huggingface_hub#1102) and will make a patch release as suggested.

As for having the CI run on a windows machine as well for huggingface_hub, this is planned as it is not the only Windows-related that we got lately.

(and sorry for late reply, I was off last week :) )

@Wauplin
Copy link

Wauplin commented Oct 11, 2022

@BenjaminBossan @adrinjalali I just made a patch release for huggingface_hub that forces utf-8 encoding. You should be good to go now :)

@BenjaminBossan
Copy link
Collaborator Author

@Wauplin I bumped the min version of huggingface_hub and now all tests are passing, big thanks.

Copy link
Member

@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.

@adrinjalali adrinjalali changed the title Move to huggingface_hub v0.10 MNT Move to huggingface_hub v0.10 Oct 11, 2022
@adrinjalali adrinjalali merged commit d921b00 into skops-dev:main Oct 11, 2022
@Wauplin
Copy link

Wauplin commented Oct 11, 2022

@BenjaminBossan Perfect !

@BenjaminBossan BenjaminBossan deleted the use-hf-hub-0.10 branch October 11, 2022 09: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.

Test and integrate model cards from Hub library
4 participants