@logseq/logmind
v0.1.7
Published
Downloads
3
Keywords
Readme
Based on https://transformers-js.praeclarum.org/
Pre-release: https://drive.google.com/file/d/1ZguyJ3PAr1Azn2wNzN2qbsIF6lw-BkKY/view?usp=sharing
Dev / Build:
Prepare model according to https://github.com/praeclarum/transformers-js
yarn
yarn dev
| yarn build
Test:
Vitest: yarn test
Chromium dev test: yarn dev
and open the corresponding entry, then check the console.
Don't use firefox
Test in downstream:
test cases are exposed as browser_tests
and can be called in downstream.
Misc: Lock-in onnxruntime-web for model opset. Test model first if you want to use a newer runtime ver.
The build warning can be ignored:
Unable to determine content-length from response headers. Will expand buffer when needed.
https://github.com/xenova/transformers.js/blob/aceab9bf3d1be9dadf6601b8f775e519376258e3/src/utils/hub.js#L547
不太需要管
https://github.com/xenova/transformers.js/blob/aceab9bf3d1be9dadf6601b8f775e519376258e3/src/utils/hub.js#L476-L482
transforming (110) node_modules/onnxruntime-web/lib/onnxjs/backends/webgl/ops/im2col.js'worker-loader?inline=no-fallback!./proxy-worker/main' is imported by worker-loader?inline=no-fallback!./proxy-worker/main?commonjs-external, but could not be resolved – treating it as an external dependency
As we are not using the ONNXRT built-in proxy feature (see here)
Reference: https://dev.to/franciscomendes10866/how-to-use-service-workers-with-react-17p2 https://github.com/xenova/transformers.js/blob/a5ca113d51454ef4469bfe4f74970e483df4830b/examples/demo-site/src/worker.js#L92