-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Remove modelcards dependency #2050
Remove modelcards dependency #2050
Conversation
The documentation is not available anymore as the PR was closed or merged. |
@@ -87,10 +83,11 @@ def get_full_repo_name(model_id: str, organization: Optional[str] = None, token: | |||
|
|||
|
|||
def create_model_card(args, model_name): | |||
if not is_modelcards_available: | |||
if not is_jinja_available(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@@ -21,6 +21,7 @@ | |||
from collections import OrderedDict | |||
from typing import Union | |||
|
|||
from huggingface_hub.utils import is_jinja_available # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure this is supported since huggingface_hub 0.10
? That's currently our minimum required version for the Hub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah you answered that above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean! Good to merge for me. Let's wait until the tests are green and then we can merge :-)
That was a quick review! 😄 Thanks |
* Switch to huggingface_hub.ModelCard * Remove modelcards dependency in favor of Jinja2
While working on #2047, I realized that
diffusers
depends onmodelcards
package which is deprecated and not maintained anymore. This PR switches to thehuggingface_hub
implementation -a copy ofmodelcards
with a few fixes-. It has been integrated tohfh
in version0.10
which is already a requirement fordiffusers
.To make it work, one must have
Jinja2
installed which was already a requirement. I've updated thecreate_model_card
helper and wrote a test for it. Actually I'm not sure it was working at all as the template path seemed to be wrong.(this PR also removed
is_modelcards_available
boolean method. Idk the deprecation policy indiffusers
but I can put it back if needed. I have added ais_jinja_available
(fromhuggingface_hub.utils
) which is more appropriate now.Note: this is not related to the
0.12
release ofhuggingface_hub
. It can be merged before or after it doesn't matter (or never)