-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
I'm trying to get an assert
working for #425; Despite no issues in WebAssembly, the following error message is dumped:
Using fallback gemm implementation
<p>Hallo Welt!</p> <p>Wiedersehen Welt!</p>
string
DocumentFragment {}
<p>Hallo Welt!</p>
Aborted(undefined)
undefined:448
var e = new WebAssembly.RuntimeError(what);
^
RuntimeError: Aborted(undefined). Build with -s ASSERTIONS=1 for more info.
at abort (eval at <anonymous> (/home/jerin/code/bergamot-translator/build-wasm/node-test.js:1:1), <anonymous>:448:10)
at assert (eval at <anonymous> (/home/jerin/code/bergamot-translator/build-wasm/node-test.js:1:1), <anonymous>:116:3)
at Object.onRuntimeInitialized (/home/jerin/code/bergamot-translator/build-wasm/node-test.js:112:3)
The following is the relevant source:
...
// Construct std::vector<std::string> inputs;
const input = new Module.VectorString();
input.push_back('<p> Hello world! </p> <p> Goodbye World! </p>');
// Construct std::vector<ResponseOptions>
const options = new Module.VectorResponseOptions();
options.push_back({qualityScores: false, alignment: true, html: true});
// Translate our batch (of 1)
const output = service.translate(model, input, options);
// Get output from std::vector<Response>
const translation = output.get(0).getTranslatedText()
console.log(translation)
console.log(typeof (translation));
const fragment = JSDOM.fragment(translation)
console.log(fragment)
console.log(fragment.firstElementChild.outerHTML)
assert(fragment.childElementCount === 1); // This fails, because 2, and has nothing to do with WebAssembly?
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation