-
Notifications
You must be signed in to change notification settings - Fork 809
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
Support opus-mt-mul-en translation in WebGPU #841
Comments
Answering my own question of course. Firstly, I was wrong, Secondly, I found references to
// Hmm, in my test adding |
Aha, more clues. This issue mentions adding // hmm
|
Did some more lmiited testing: While the Opus MT translations are not perfect, on the whole they are better than the |
Thanks for investigating this! I'm revisiting this now :) Do you by any chance have any sample python code for running |
Okay I think I figured it out (issue related to the |
Cool! Unfortunately I don't have any Python code? It's 100% browser / Javascript for me. Here's some (cleaned up) parts of my code that might be useful. PREPARATION
INFERENCE
|
Sure! On it. |
Yep, that did it! Thank you! |
Great! Also, I'm terribly sorry about the delay... catching up on my long list of notifications! 😅 |
No worries, I'm frankly amazed at how hard you work. |
most likely an out-of-memory error. Are you running any quantized versions? |
That was my first thought as well. I tried with and without Switch to WASM, and it works immediately. |
@guschmue might be able to help debug |
@flatsiedatsie Can you share an app (workable on WASM, but failed with WebGPU)? We can take a look from ONNX Runtime WebGPU side. |
@gyagp I can. I'll send you an email with a sneak preview link to my soon-to-be-released project. |
Email sent. |
Question
I've been having some trouble where translation sometimes wasn't working. For example, I just tried translating Polish into English using
opus-mt-mul-en
. But if outputs empty strings.So I started looking for what could be wrong, and in the Transformers.js source code I found this
marian.py
file:https://github.com/xenova/transformers.js/blob/7f5081da29c3f77ee830269ab801344776e61bcb/scripts/extra/marian.py#L18
It lists the supported Opus MT models, and while the model is available on Huggingface (https://huggingface.co/Xenova/opus-mt-mul-en), I'm guessing it isn't actually supported (yet)?
Do I understand correctly?
Related: is there a setting with the
mul
models that I need to set to select which language is translated into?For completeness, here's some of my code:
Constructing the model:
And getting a translation out:
.. which already begs the question: as
oput-mt-en-mul
is supported according to that file, ...then how would that multi-model know what language to output to?I'll continue searching to see if I can answer my own question :-)
The text was updated successfully, but these errors were encountered: