Comments (7)
Hi @xenova, sorry to have bothered you. I solved this problem by upgrading @quasar/app-vite to ^2.0.0-beta.12 and vite to ^5.2.10.
Thanks anyway!
from transformers.js.
I had the same issue. adding
import { nodePolyfills } from "vite-plugin-node-polyfills";
export default defineConfig((configEnv) => ({ plugins: [ nodePolyfills({ exclude: ["stream"] }), ], }));
to vite.config.ts seems to have resolved it.
But now I get
My code is from the sentiment-analysis pipelines API docs
I have a vanilla typescript 5.4.3, with vite/5.2.2 win32-x64 node-v22.1.0 project
from transformers.js.
I think I should be able to just remote that import (since we don't support node < 18 anymore).
from transformers.js.
#752 should fix this.
from transformers.js.
Hi I'm having a problem when importing @xenova/transformers in vite. Basically it's trying to import onnxruntime-node and sharp, which are not supposed to be imported as they are native modules, and this is causing all sorts of errors. I have also tried to ask here: vitejs/vite#10314 (comment)
I've tried adding vite-plugin-node-polyfills and have removed it as it did not seem to help the errors.
@bekatan and @jzyzxx, do you know how to get @xenova/transformers working in a vite project?
from transformers.js.
@customautosys The default vite settings should be able to ignore these by looking at the package.json's browser field. Could you provide more information about your environment?
See here for an example: https://github.com/xenova/transformers.js/tree/main/examples/depth-anything-client
from transformers.js.
@customautosys The default vite settings should be able to ignore these by looking at the package.json's browser field. Could you provide more information about your environment?
See here for an example: https://github.com/xenova/transformers.js/tree/main/examples/depth-anything-client
I am using https://github.com/quasarframework/quasar
I asked them and they said the cache for the node_modules is built by Vite and it's not something Quasar does.
I don't know why Vite seems to be ignoring the browser field. I've tried Vite versions 3, 4 and 5 and nothing works. I couldn't find anything in the Vite documentation about any flag controlling whether the browser field is ignored.
from transformers.js.
Related Issues (20)
- TypeError: Cannot read properties of undefined (reading 'create') HOT 6
- Any plans to add moondream and build a demo? Xenova/moondream2 HOT 2
- TypeError: Failed to fetch dynamically imported module HOT 4
- Error using Xenova/nanoLLaVA in pipeline HOT 4
- Excessive Memory consumption. HOT 4
- could not find model_q4.onnx_data (v3 PR) HOT 1
- Uncaught (in promise) Error: no available backend found. ERR: [webgpu] TypeError: Failed to fetch dynamically imported module: HOT 11
- Options for the "translation" pipeline when using Xenova/t5-small
- Have considered using wasm technology to implement this library? HOT 1
- Example not working on Chrome/Arc v.124(M1 Mac) HOT 5
- Can you use all transformers models with transformers.js?
- Request to support suno-ai/bark model HOT 2
- Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. HOT 4
- v3: Issue loading T5-Small with webgpu backend HOT 1
- WebAssembly Compilation Error Due to CSP Restrictions HOT 5
- [v3] webgpu-chat demo fails with `no available backend found`
- How to point to a specific model path in order to use compressed models? (brotli) HOT 1
- Method to send `HF_TOKEN` from the client side
- Pipeline execution time with 'image-classification' pipeline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers.js.