Conversation
| remotePathTemplate: '{model}/resolve/{revision}/', | ||
|
|
||
| allowLocalModels: !(IS_BROWSER_ENV || IS_WEBWORKER_ENV), | ||
| allowLocalModels: !(IS_BROWSER_ENV || IS_WEBWORKER_ENV || IS_DENO_RUNTIME), |
There was a problem hiding this comment.
Deno doesn't support relative URLs, so this is necessary... even if we have filesystem access
| .replace( | ||
| `"object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type`, | ||
| "false", | ||
| ) | ||
| .replace( | ||
| `typeof globalThis.process?.versions?.node == 'string'`, | ||
| "false", | ||
| ) |
There was a problem hiding this comment.
Very hacky, but is a current workaround, otherwise we get errors related to worker_threads not being prefixed with node:
cc @fs-eire if you have a better idea.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
|
||
| } else if (apis.IS_NODE_ENV) { | ||
| ONNX = ONNX_NODE.default ?? ONNX_NODE; | ||
| } else if (apis.IS_NODE_ENV && (ONNX = ONNX_NODE.default ?? ONNX_NODE)?.InferenceSession) { |
There was a problem hiding this comment.
Handles an edge case where it is a node-like environment (e.g., Deno), but we are running in an environment where onnxruntime-node is not bundled (but onnxruntime-wasm is)
|
Turns out, this is also necessary to ensure v0.dev operates correctly, otherwise we get this error: |
could you try replace "worker_threads" to "node:worker_threads"? |
|
Unfortunately, I've tried that and it doesn't fix the issue: Deno: v0: |
An experimental branch/PR to test running Transformers.js in Deno's WASM and WebGPU runtimes. This is a bit hacky, but it works... at least for now!
You can test this out by building this PR, and hosting the js files locally.
NOTE: This is different to running with the native EP (#1306), which will enable WebGPU support in Deno, via ONNXRuntime's Native WebGPU EP implementation.
There are some bugs/limitations with the current runtime (based on wgpu), e.g.,
but WASM works well 👍
cc @crowlKats for viz