We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d8f511 commit 4a6b8ccCopy full SHA for 4a6b8cc
examples/demo-site/src/worker.js
@@ -292,7 +292,7 @@ async function token_classification(data) {
292
let currentChunk = { type: '', text: [] };
293
294
for (let i = 0; i < outputs.length; i++) {
295
- let word = pipeline.tokenizer.model.tokens_to_ids[outputs[i].word];
+ let word = pipeline.tokenizer.model.tokens_to_ids.get(outputs[i].word);
296
let entity = outputs[i].entity;
297
298
if (entity.startsWith('B-')) { // beginning of a new chunk
0 commit comments