api-inference-community
api-inference-community copied to clipboard
👷 Automatically dispatch tasks to hf.js
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
Thanks for the ping @coyotte508. We don't have a LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS
equivalent in Python but good to know :+1:
This dispatch thing looks really cool! I haven't used this feature but the code seems reasonable.
@glegendre01 now that the PR is approved can you handle that please :pray: ?
Set a
REPO_DISPATCH_TOKEN
secret, a PAT that has read/write & metadata onhuggingface/huggingface.js
(don't have admin access on the repo and we probably want a token from machineuser)
@coyotte508, secret created. can you test it ?
@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)
ok for the record @glegendre01 the token works (reran job with :heavy_check_mark:)
ok, keep me informed if we need to clean up the token finally