Skip to content

Conversation

@sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Sep 8, 2025

TODOs

  • Add an example?
  • Add a test (staging test perhaps)?

One can easily run kernels upload <path_to_build_dir> --repo_id=my-hub-username/my-kernel-name to upload their cool kernels to the Hub.

@HuggingFaceDocBuilderDev

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.

@sayakpaul
Copy link
Member Author

@danieldk

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:

build/torch-universal/upload_test/**.

I created a local folder first mimicking this structure, including __init__.py and foo_2024.py files, as discussed. I then issued kernels upload build repo_id=sayakpaul/kernels-upload-test.

I then renamed to foo_2050.py and issued the same command as above.

P.S.: Do you have a single command to run that would take care of formatting and linting before I commit? In diffusers, we usually have make style && make quality.

@danieldk
Copy link
Member

P.S.: Do you have a single command to run that would take care of formatting and linting before I commit? In diffusers, we usually have make style && make quality.

We don't have one yet, I'll add this!

@sayakpaul
Copy link
Member Author

@danieldk your feedback comments have been addressed.

@sayakpaul sayakpaul requested a review from danieldk September 12, 2025 09:00
@sayakpaul
Copy link
Member Author

sayakpaul commented Sep 12, 2025

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.

Comment on lines 492 to 502
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
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@sayakpaul
Copy link
Member Author

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

danieldk
danieldk previously approved these changes Sep 15, 2025
Copy link
Member

@danieldk danieldk left a 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.

@sayakpaul
Copy link
Member Author

As discussed over Slack, we're currently xfailing the test on GitHub CI. In a follow-up, we will use a staging environment for this test :)

@sayakpaul sayakpaul requested a review from danieldk September 16, 2025 05:26
@danieldk danieldk merged commit d6b51ee into huggingface:main Sep 16, 2025
7 checks passed
@sayakpaul sayakpaul deleted the upload-hub branch September 16, 2025 06:59
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.

3 participants