-
Notifications
You must be signed in to change notification settings - Fork 25
[feat] add an uploading utility. #138
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
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
I think I made the changes that we discussed. To test this for now, I created https://huggingface.co/sayakpaul/kernels-upload-test/ which has the following structure:
I created a local folder first mimicking this structure, including I then renamed to P.S.: Do you have a single command to run that would take care of formatting and linting before I commit? In |
We don't have one yet, I'll add this! |
Co-authored-by: Daniël de Kok <me@danieldk.eu>
|
@danieldk your feedback comments have been addressed. |
|
I think the current test failure will pass after we move the test repository to a suitable place for which I believe we have already configured an HF Token as a GitHub secret. |
src/kernels/utils.py
Outdated
| def _get_filenames_from_a_repo(repo_id: str) -> List[str]: | ||
| try: | ||
| repo_info = model_info(repo_id=repo_id, files_metadata=True) | ||
| repo_siblings = repo_info.siblings | ||
| if repo_siblings is not None: | ||
| return [f.rfilename for f in repo_siblings] | ||
| else: | ||
| raise ValueError("No repo siblings found.") | ||
| except Exception as e: | ||
| logging.error(f"Error connecting to the Hub: {e}.") | ||
| raise |
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.
I think this can go to the test now, since it's only used there.
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.
Done!
|
We might have to configure the HF_TOKEN secret and then make it available in https://github.com/huggingface/kernels/actions/runs/17673702006/workflow?pr=138#L53 |
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.
Looks great! Let's merge after we get the CI bits sorted out.
|
As discussed over Slack, we're currently |
TODOs
One can easily run
kernels upload <path_to_build_dir> --repo_id=my-hub-username/my-kernel-nameto upload their cool kernels to the Hub.