Open JesusP2 opened 3 weeks ago
That error message implies a 404 error, and the code it trying to load a 404 error HTML page as if it were JSON.
I'd check if that URL you're loading actually exists.
Well yeah I see it's returning an HTML instead of json, that's why JSON.parse fails. My question is why is it doing this only when I run the code on the browser and not on node? the model exists 100%.
Hmm. Could you try adding this to a htaccess file?
AddType text/javascript .js .ts .mjs .cjs
AddType application/wasm wasm
Do you have any browser plugins that might me over-protecting? uBlock origin? uMatrix? Brave Shields?
what does that file do? and no, I've tried on a fresh chrome installation and I get the same error
I asked because the only info I get is related to apache, which I didn't even mention in the post.
why is it doing this only when I run the code on the browser and not on node?
System Info
transformers.js version: 2.17.2 browsers: all I've tried so far(firefox and chrome) OS: arch linux x86_64 node version: 20.17.0
Environment/Platform
Description
I'm trying to run some models on the browser but I don't think they are even getting downloaded, I've tried 2: Xenova/modnet and onnx-community/BiRefNet_lite but I got the same error. I managed to run it on node but not the browser. I get this error: that points to this section of the code I believe: https://github.com/xenova/transformers.js/blob/main/src/utils/hub.js#L571
I'm running SAM (Xenova/slimsam-77-uniform) on a different worker but that one works perfectly fine, no idea if I'm doing something wrong for Birefnet/modnet.
Reproduction
1.- clone https://github.com/JesusP2/transformers-error-repro 2.- install dependencies (npm i) 3.- run the project (npm run dev) 4.- go to the website and upload an image
Also if you want to run the code on node run "node node.js" and that should run the model server-side(it works).