-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Add Bottleneck T5 (e.g., thesephist/contra-bottleneck-t5-small-wikipedia
)
#360
Comments
Hi there 👋 the When it comes to weird issues like that, it's usually because of outdated build tools (like create-react-app, or something). Could you share what tools and versions you are using? |
Ah, interesting. I'll put a repo together and share it shortly |
I uploaded a repository here (https://github.com/keviddles/contra-bottleneck-t5-demonstration), but I'm having trouble getting it to deploy to github pages. Will comment if I can get that working. I think the issue is probably that I'm loading the model wrong. The code I'm using to load the model is:
And that produces the error:
Alternatively, if I load the model with:
I see: I started with the former command (using |
Oh, follow up question: must models be available on the Hub, or can they be available locally? I've only been trying locally, I didn't realize that they might need to be uploaded to the hub first. |
Thanks! At first glance, your usage looks correct. Could you just let me know which transformers.js version you have installed? We did previously have some issues with minification (which lead to a similar error message as the one you are seeing). Fortunately, those have been resolved now in 2.6.2
No, you can use the models locally too 👍 I just wanted to test, so if you have them on the hub, it will be easier to see what the problem is :) I assume you've already converted it to ONNX, right? (note that transformers.js can't load the model you have listed out-of-the-box, since it doesn't contain the ONNX weights + graph). See here for more information. |
Gotcha, let me upload them to the hub so they're available for testing.
Yep, converted them and they seemed to convert fine. |
I think I know what the problem is: t5-models aren't generally used as causal LMs (decoder-only / self.model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True).to(self.device) Also, optimum doesn't actually support exporting t5 models for text-generation (see here). Instead, it only supports text2text-generation. I would assume that it will export dummy encoder weights when you exported with optimum (even though you will only be using the decoder during inference). cc @fxmarty any ideas? |
Ah, interesting feedback. So presumably, the exported model is not viable. I uploaded the models here, if there's some easy way to tell whether it's viable or not: https://huggingface.co/keviddles/contra-bottleneck-t5-demonstration-onnx/tree/main |
thesephist/contra-bottleneck-t5-small-wikipedia
)
You may be able to export it to ONNX with custom configurations, a recent addition to the Optimum library. Also, since the "Bottleneck T5" architecture is custom code (built on top of HF transformers), it may be a good idea to make a feature request in the original transformers library too. |
Thanks for the feedback, @xenova . It'll probably be a while since I pick this back up, so I will close this issue for now. If others want to pick it up, feel free to reopen. |
Name of the feature
I'd love to leverage https://huggingface.co/thesephist/contra-bottleneck-t5-small-wikipedia in the browser
It is not listed in the supported models above, though I have been able to convert it locally.
However, I can't import it in JS as I get
t5 is not supported
.I guess my question is, is this lack of support because it can't be supported, or simply because it hasn't been implemented yet?
If the latter, I'd be happy to hack on this myself if it's something you think could be supported, though I'm not quite sure where to start. Is there a guide for contributors to contribute community models?
(Let me know if it's helpful to share the converted models, they're about 800mb)
Reason for request
I'd love to port this colab to Javascript: https://colab.research.google.com/drive/1CF5Lr1bxoAFC_IPX5I0azu4X8UDz_zp-?usp=sharing#scrollTo=1hwxFKZzFKn5
The text was updated successfully, but these errors were encountered: