Open NingW101 opened 2 months ago
I submitted #903 to fix the bug in text-generation
example, and root cause of the issue that newly generated token is not returned is similar, if this PR gets merged I can draft another patch to fix the rest of the text generation examples.
System Info
transformers.js :
@huggingface/transformers@3.0.0-alpha.13
browser: chrome node: v20.17.0Environment/Platform
Description
[ ] Test Generation
throw error when fetching models because the
model
path is not concatenated correctly,Each generated token will not be returned by dispatching callback function when it is generated, and the entire text will be returned only after the whole generation process is completed.
[ ] The other text generation examples (translation, summarize, image-to-text) also had problems getting each newly generated token even though the callback function was defined and passed to the
pipeline
.Reproduction
examples/demo-site
@xenova/transformers.js
->"@huggingface/transformers": "^3.0.0-alpha.10"
inpackage.json
npm i
examples/demo-site/node_modules/@hugginface/transformers
&&npm i
webpack.config.js
from the repo into thenode_modules/@hugginface/transformers
&&npm run build
cd examples/demo-site && npm run build && npm run preview