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

TranslateLocally _base_ models do not work #14

Closed
2 of 3 tasks
jelmervdl opened this issue Mar 10, 2022 · 3 comments
Closed
2 of 3 tasks

TranslateLocally _base_ models do not work #14

jelmervdl opened this issue Mar 10, 2022 · 3 comments
Assignees
Labels
bug Something isn't working upstream Depends on a fix upstream

Comments

@jelmervdl
Copy link
Owner

jelmervdl commented Mar 10, 2022

I have no idea why, but when trying to translate de.wikipedia.org with German-English base it fails, and just repeats the first word for every word in the input text.

What I've tried:

  • Older version of bergamot-translator: no difference
  • Using bergamot-translator natively: works just fine (after adding a mini-batch-words: 1024 entry to the config)
  • Using the individual model files with the worker.js from bergamot-translator, as opposed to the .tar.gz extraction happening in this fork. If yes, then this is a bug in the WASM build of bergamot-translator?

To experience this yourself: Check out c5c308a, and apply this patch to prefer base models over tiny models:

diff --git a/extension/controller/translation/translationHelper.js b/extension/controller/translation/translationHelper.js
index e9ed0c7203faf809a923d126971a5c1fd78bc277..edb3046559905f5a3f2cec7f537c6b46d13cd7ba 100644
--- a/extension/controller/translation/translationHelper.js
+++ b/extension/controller/translation/translationHelper.js
@@ -233,6 +233,8 @@ class Channel {
         // Prefer tiny models above non-tiny ones (right now base models don't even work properly 😅)
         entries.sort((a, b) => (a.shortName.indexOf('tiny') === -1 ? 1 : 0) - (b.shortName.indexOf('tiny') === -1 ? 1 : 0));
 
+        entries.reverse();
+
         if (!entries)
             throw new Error(`No model for ${from} -> ${to}`);
 

image

@jelmervdl jelmervdl added bug Something isn't working help wanted Extra attention is needed labels Mar 10, 2022
@jelmervdl
Copy link
Owner Author

Might be related to browsermt/marian-dev#81 (need to confirm that the quick patch there fixes it when run in wasm runtime)

@jelmervdl
Copy link
Owner Author

Waiting on browsermt/marian-dev#81. If that gets fixed, this is fine. If not, we might need to drop mozilla's embedded intgemm and always use the fallback path (and then probably push a few more things to get to a reasonable speedy experience.)

@jelmervdl jelmervdl added the upstream Depends on a fix upstream label Mar 29, 2022
@jelmervdl
Copy link
Owner Author

This case is mentioned in the code. I don't think Mozilla intends to fix its embedded MozIntGemm, but I also don't think Mozilla intends to ship it in any release version of Firefox. So closing this for now as the only one impacted by it would be the people that are already aware of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Depends on a fix upstream
Projects
None yet
Development

No branches or pull requests

1 participant