huggingface / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
12.07k stars 764 forks source link

segment-anything-web Demo not working on iPhone #801

Open geronimi73 opened 5 months ago

geronimi73 commented 5 months ago

System Info

https://huggingface.co/spaces/Xenova/segment-anything-web with Google Chrome (v125.0.6422.80) on iphone (iOS Version 16.5.1, Model iPhone SE)

Description

Hey,

first, transformers.js is an amazing project. THANK YOU

Second, Xenova/slimsam-77-uniform does not work on my phone. I am using the official demo. https://huggingface.co/spaces/Xenova/segment-anything-web

Chrome (v125.0.6422.80) on my iphone (iOS Version 16.5.1, Model Name iPhone SE) is stuck at the "extracting embedding" step:

IMG_85B07C865176-1 copy

I did a quick debug with Web Inspector and this is what I get on the console

Screenshot 2024-06-10 at 16 55 59

Seems like https://cdn.jsdelivr.net/npm/@xenova/transformers.min.js.map goes 404, not sure if this is the cause but I don't get this error when I run it on my desktop.

Any help appreciated.

Reproduction

  1. open Chrome on iOS
  2. https://huggingface.co/spaces/Xenova/segment-anything-web
  3. Click "try example"
xenova commented 4 months ago

Hi there! 👋 Thanks for debugging - the console logs are really helpful here. Indeed OrtRun(). error code = 6 is typically for out-of-memory issues, which is a bit unexpected due to the small model size, but supposedly the RAM usage increases significantly during embedding computation. 😞 This might be improved with v3 - which uses a more up-to-date version of onnxruntime-web, but I haven't tested yet 👀

geronimi73 commented 4 months ago

thank you!

something maybe related, I just noticed that the space uses a lot of memory, at least that's what Chrome says. Is this expected?

Screenshot 2024-07-02 at 12 16 00
xenova commented 4 months ago

Mine says something way different 👀 (this is after loading and using the model):

image