-
Notifications
You must be signed in to change notification settings - Fork 390
Add Transformers.js as a supported library #854
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 documentation is not available anymore as the PR was closed or merged. |
|
Edit: Looks like it's now magically working? 👀 |
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.
Thanks a lot! I don't think the TODOs should block this PR, I think we can move ahead with it
pcuenca
left a comment
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.
Excellent! I agree with Omar, we can move forward with this and iterate with the items in the to-do list :)
julien-c
left a comment
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.
Add --push_to_hub option to conversion script. Once this is one, I can add the checkbox to /docs/hub/models-libraries.md.
This is quite cool, do you use huggingface.js as a dependency to do that?
|
|
||
| To install via [NPM](https://www.npmjs.com/package/@xenova/transformers), run: | ||
| ```bash | ||
| npm i @xenova/transformers |
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.
off topic from this PR, but maybe at some point we should ship it under npm i @huggingface/transformers (can be decoupled from moving the actual repo, i.e. i think the repo under your namespace is great)
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.
That would be HUGE! 🚀 We can maybe align the move with a major version release too 👍 (e.g., when WebGPU is supported?). On that note, however, the npm docs say that it isn't possible to transfer a scoped package to another organization. So, we'll either need to create a new package in the new scope, or get custom support for this.
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.
creating a new package is probably fine.
Pinging @coyotte508 to add you to our npm org for when we want to make the switch
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.
@julien-c I think you will have to do it, I don't see the option

Alternatively we can add the secret to the repo (like when publishing hf.js), to be able to publish through github actions
Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
The conversion script is in python, so I'll just use |
|
Ok i see! |
See js/src/lib/interfaces/Libraries.ts Co-authored-by: Julien Chaumond <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
|
Okay I've made the suggested changes (thanks!) 👍 Just one thing I haven't been able to test:
Is the language (for code highlighting) auto-detected (or is it hard-coded to python)? I don't quite know how to test this. |
i don't remember, but we'll see in prod I guess :) (and if it doesn't work feel free to open an issue in moon-landing) |
pcuenca
left a comment
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 good!
osanseviero
left a comment
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.
Very nice! Let's goo 🔥 🚀
|
For TODOs, feel free to create separate issues :) I'll merge this |
Yep - looks like it defaults to python. e.g.. Not a big deal though, since the copy-pasting still works fine. |
|
@xenova As Julien said, maybe we can open a (non-urgent) issue in moon-landing :) |
|
@pcuenca Done! |

Currently working on improving how Transformers.js models are viewed and searched for on the hub. I tried to follow this PR as closely as possible. Here's the initial draft, and I plan to make the following changes:
TODO:
--push_to_huboption to conversion script. Once this is one, I can add the checkbox to /docs/hub/models-libraries.md.AutoModel,AutoTokenizer,AutoProcessor, etc. classes. I plan to add code snippets (/usage example) to each Transformers.js model card on the hub, so, it probably is okay to just keep the example code block as it is.On another note, I noticed that many tasks supported by transformers (the python library) are not listed in
TASKS_MODEL_LIBRARIES(tasks/src/const.ts).