This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Integrate Basic QE feature #144
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bb45bb9
Loading translation engine with appropriate QE config
abhi-agg 4901ca5
Pas quality estimation flag for each text item of translate api
abhi-agg e5c40cd
Added cacheSize field in config to construct TranslationService
abhi-agg 11217d8
Ran linting
abhi-agg c51083c
Updated bergamot engine to 0.4.2
abhi-agg f989473
Encode plain text to HTML before sending it to engine when QE is on
abhi-agg 549b4cb
Ran linter
abhi-agg 4e47bd5
(Discard later) Debugging
abhi-agg 6436fc7
Fixed merge code when QE is on
abhi-agg dc333bb
Removed a debug log
abhi-agg 5ea4451
Ran linter
abhi-agg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* eslint-disable */ | ||
// This file is autogenerated using scripts/update-begamot-version.sh | ||
const BERGAMOT_VERSION_FULL = "v0.3.1+793d132"; | ||
const BERGAMOT_VERSION_FULL = "v0.4.2+ab7f84f"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* eslint-disable no-unused-vars */ | ||
|
||
let engineRegistryRootURL = "https://github.com/mozilla/bergamot-translator/releases/download/v0.4.1/"; | ||
let engineRegistryRootURL = "https://github.com/mozilla/bergamot-translator/releases/download/v0.4.2/"; | ||
const engineRegistryRootURLTest = "https://example.com/browser/browser/extensions/translations/test/browser/"; | ||
|
||
const engineRegistry = { | ||
bergamotTranslatorWasm: { | ||
fileName: "bergamot-translator-worker-with-wormhole.wasm", | ||
fileSize: 6923132, | ||
sha256: "26c24d3695eab02e91f20c68a8c1f7587d2a3e338a6f057f407c39a7e6c2c321" | ||
fileSize: 6929232, | ||
sha256: "cccc905f2ccbdbf13d38e640151f06f04ed5568f34fd1ee1a6c4bf73147e2c3f" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just a note: a cache size of 10 won't do you much good. The cache is non-probing, it is basically just
cache[hash(sentence) % cacheSize]
. The description of the parameter is a bit indirect about that. If you set it too low, you'll end up having too many different sentences hitting the same cache entry, constantly overwriting each other, and no cache benefit at all.In my experience you'd get about 20% occupancy, so if you set it to 50 you'd be caching about 10 sentences. But from testing in TranslateLocally and my extension fork, I'd suggest starting with something around 1000 or higher, and see whether you can notice it in the memory usage.
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 for the tip Jelmer, please keep them coming. I think caching will be particularly helpful after I move the engine to the background script last week. I heard from the security folks that's fine, so I think that will be helpful.