Update bergamot-translator to the latest version
This commit is contained in:
Родитель
ace5bb3706
Коммит
76ef5d8a69
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -248,7 +248,7 @@ class TranslationHelper {
|
|||
cpu-threads: 0
|
||||
quiet: true
|
||||
quiet-translation: true
|
||||
gemm-precision: int8shiftAll
|
||||
gemm-precision: int8shiftAlphaAll
|
||||
`;
|
||||
|
||||
const modelFile = `${modelRegistryRootURL}/${languagePair}/${modelRegistry[languagePair].model.name}`;
|
||||
|
@ -410,8 +410,11 @@ class TranslationHelper {
|
|||
}
|
||||
const translationModel = this.translationModels.get(languagePair);
|
||||
|
||||
// instantiate the arguments of translate() API i.e. ResponseOptions and input (vector<string>)
|
||||
const responseOptions = new this.WasmEngineModule.ResponseOptions();
|
||||
/*
|
||||
* instantiate the arguments of translate() API i.e. ResponseOptions and input (vector<string>)
|
||||
* const responseOptions = new this.WasmEngineModule.ResponseOptions();
|
||||
*/
|
||||
const responseOptions = { qualityScores: true, alignment: false, html: true };
|
||||
let input = new this.WasmEngineModule.VectorString();
|
||||
|
||||
// initialize the input
|
||||
|
@ -435,7 +438,6 @@ class TranslationHelper {
|
|||
sourceSentencesOfParagraphs.push(this.getAllSourceSentencesOfParagraph(result.get(i)));
|
||||
}
|
||||
|
||||
responseOptions.delete();
|
||||
input.delete();
|
||||
return translatedParagraphs;
|
||||
}
|
||||
|
@ -477,7 +479,6 @@ class TranslationHelper {
|
|||
|
||||
const translationHelper = new TranslationHelper(postMessage);
|
||||
onmessage = function(message) {
|
||||
console.log("message no worker", message.data[0]);
|
||||
switch (message.data[0]) {
|
||||
case "configEngine":
|
||||
importScripts("Queue.js");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* eslint-disable no-unused-vars */
|
||||
|
||||
const engineRegistryRootURL = "https://storage.googleapis.com/bergamot-models-sandbox/wasm/4/";
|
||||
const engineRegistryRootURL = "https://550-305366423-gh.circle-artifacts.com/0/wasm-wormhole/";
|
||||
|
||||
const engineRegistry = {
|
||||
bergamotTranslatorWasm: {
|
||||
fileName: "bergamot-translator-worker.wasm",
|
||||
fileSize: 6814441,
|
||||
sha256: "618d1d55998dc45185807c9cc1a95bd1c3ce0f566a324a73c033c73a1cb01a4f"
|
||||
fileSize: 6831085,
|
||||
sha256: "1a00dd8ffeaf8cbab7237d9bb8ecc94ca2f7c3cf139b92fa7e8f4dab4ebcb37e"
|
||||
}
|
||||
}
|
|
@ -145,7 +145,6 @@ class InPageTranslation {
|
|||
* send the content back to mediator in order to have the translation
|
||||
* requested by it
|
||||
*/
|
||||
|
||||
const payload = {
|
||||
text: text.split("\n"),
|
||||
type: "inpage",
|
||||
|
|
Загрузка…
Ссылка в новой задаче