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

👷 Automatically dispatch tasks to hf.js #355

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

coyotte508
Copy link
Member

@coyotte508 coyotte508 commented Nov 28, 2023

This will send a dispatch even to hf.js, where we need to create a matching action to receive the event with repository_dispatch: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch

This will allow us to automate updating https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/library-to-tasks.ts (with an action that will open a PR to this file)

cc @pcuenca @mishig25 @osanseviero @julien-c

cc @Wauplin in case you might want that too for some reason

Migration

Set a REPO_DISPATCH_TOKEN secret, a PAT that has read/write & metadata on huggingface/huggingface.js

@coyotte508 coyotte508 marked this pull request as ready for review November 28, 2023 15:24
@Wauplin
Copy link
Contributor

Wauplin commented Nov 28, 2023

Thanks for the ping @coyotte508. We don't have a LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS equivalent in Python but good to know 👍

@xianbaoqian
Copy link
Contributor

This dispatch thing looks really cool! I haven't used this feature but the code seems reasonable.

client-payload: |
{
"tasks": ${{ steps.export_tasks.outputs.payload }}
Copy link
Member

Choose a reason for hiding this comment

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

Nice! How is this payload received and interpreted in the remote repo, is that already in place?

Copy link
Member Author

Choose a reason for hiding this comment

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

now that the PR is approved as soon as #355 (comment) is handled will work on it

we need to create a github workflow with repository_dispatch on hf.js

@coyotte508
Copy link
Member Author

@glegendre01 now that the PR is approved can you handle that please 🙏 ?

Set a REPO_DISPATCH_TOKEN secret, a PAT that has read/write & metadata on huggingface/huggingface.js

(don't have admin access on the repo and we probably want a token from machineuser)

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

@osanseviero are we sure this is needed?

I feel like with the Inference revamp will we even still have this repo?

@glegendre01
Copy link

@coyotte508, secret created. can you test it ?

@osanseviero
Copy link
Contributor

@julien-c fair point; let's pause this PR as a bunch of this might be unneeded in a couple of weeks and this is mostly to update a .ts file that does not change very often (just when a new task is added in this API)

@coyotte508
Copy link
Member Author

ok for the record @glegendre01 the token works (reran job with ✔️)

@coyotte508 coyotte508 marked this pull request as draft December 5, 2023 16:05
@glegendre01
Copy link

ok, keep me informed if we need to clean up the token finally

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.

7 participants