transformers.js
transformers.js copied to clipboard
Converted QA model answers in lower case, original model does not. What am I doing wrong?
Question
I have converted deutsche-telekom/electra-base-de-squad2 to ONNX using python -m scripts.convert --quantize --model_id deutsche-telekom/electra-base-de-squad2
. The ONNX model, used with the same code, yields returns in lower case, whereas the original model returns the answer respecting case sensitivity. I noticed that the tokenizer_config.json" in the original model contains
"do_lower_case": false. But even setting this to
true``` before converting does not work. What am I dpoing wrong?
Code is straight forward:
import { pipeline } from '@xenova/transformers';
const pipe = await pipeline('question-answering', 'conventic/electra-base-de-squad2-onnx');
const context = "<context here, cased>";
const question = "<question here, cased>";
const out = await pipe(question, context);
console.log(out);
´´´