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

Add Huggingface Integration #916

Merged
merged 49 commits into from
Oct 16, 2024
Merged

Conversation

pranayasinghcsmpl
Copy link
Contributor

Fixes #727

Proposed Changes

  • Added Huggingface Upload & Download functionality in a subcommand.
  • Added library name, version & git hash in huggingface tags for huggingface uploads.
  • Added functionality to save a copy of config.yaml during training.

Checklist

  • CONTRIBUTING guide has been followed.
  • PR is based on the current GaNDLF master .
  • Non-breaking change (does not break existing functionality): provide as many details as possible for any breaking change.
  • Function/class source code documentation added/updated (ensure typing is used to provide type hints, including and not limited to using Optional if a variable has a pre-defined value).
  • Code has been blacked for style consistency and linting.
  • If applicable, version information has been updated in GANDLF/version.py.
  • If adding a git submodule, add to list of exceptions for black styling in pyproject.toml file.
  • Usage documentation has been updated, if appropriate.
  • Tests added or modified to cover the changes; if coverage is reduced, please give explanation.
  • If customized dependency installation is required (i.e., a separate pip install step is needed for PR to be functional), please ensure it is reflected in all the files that control the CI, namely: python-test.yml, and all docker files [1,2,3].

@pranayasinghcsmpl pranayasinghcsmpl requested a review from a team as a code owner August 14, 2024 12:03
Copy link
Contributor

github-actions bot commented Aug 14, 2024

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Copy link
Collaborator

@sarthakpati sarthakpati left a comment

Choose a reason for hiding this comment

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

Before I start reviewing this in earnest, I would need at least the following 2 pieces of information to be added to the PR:

  1. Documentation: (it is absolutely fine to have a bullet point list of items that link to the main HF docs)
  2. Tests

I believe both of these were present in the previous PR.

setup.py Outdated Show resolved Hide resolved
@sarthakpati
Copy link
Collaborator

Hi @Wauplin and @NielsRogge - this PR looks good from my end. Do you have any feedback?

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.

Hey there 👋 Thanks for the ping!

I left a few comments from an outsider point of view. I do think that the CLI should be more opinionated (understand "have less options and decide things for the user") otherwise we pretty much end up with a CLI close to what huggingface-cli upload and huggingface-cli download do.

GANDLF/cli/huggingface_hub_handler.py Outdated Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Outdated Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Outdated Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
@sarthakpati
Copy link
Collaborator

@pranayasinghcsmpl some lint fixes (unused variables and whatnot) will be needed for this PR. Thanks for taking care of it!

Thanks for your comments and suggestions, @Wauplin!

@sarthakpati
Copy link
Collaborator

Support ticket generated with Codacy to explore the coverage issue.

@sarthakpati
Copy link
Collaborator

Codacy folks suggested not to use coverage reporter for anything coming in from other forks 🙄

Anyway, we should be good to go from my end. @Wauplin is this PR good to merge for you?

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.

Integration looks good yes :) I left a few comments but nothing blocking on my side.
Thanks for the iterations!

GANDLF/cli/huggingface_hub_handler.py Outdated Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Outdated Show resolved Hide resolved
GANDLF/cli/huggingface_hub_handler.py Show resolved Hide resolved
GANDLF/entrypoints/hf_hub_integration.py Show resolved Hide resolved
GANDLF/entrypoints/hf_hub_integration.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@sarthakpati
Copy link
Collaborator

@Wauplin I think this PR is good to merge from my side. Could you please confirm and resolve your comments? I think the remaining parts can be taken up in separate issues/PRs. Thoughts?

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.

Hi @pranayasinghcsmpl, thanks for the ping!
I think the logic looks good now :) I'll let you resolve the comment you want (most of them are already resolved, right?) and merge this PR 🤗

@sarthakpati sarthakpati merged commit 301c188 into mlcommons:master Oct 16, 2024
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2024
@sarthakpati
Copy link
Collaborator

Thank you all for all the help and feedback during this effort! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Hugging Face Hub integration
3 participants