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.06k stars 764 forks source link

A numeric error is thrown by pipeline during text-generation model loading #1024

Open DawitJung opened 2 days ago

DawitJung commented 2 days ago

System Info

  1. Apple M2 Pro
  2. mac OS Sequoia v15.0.1
  3. Google Chrome v130.0.6723.116
  4. @huggingface/transformers v3.0.2

Environment/Platform

Description

į„‰į…³į„į…³į„…į…µį†«į„‰į…£į†ŗ 2024-11-13 į„‹į…©į„’į…® 3 37 14

I'm encountering an issue while trying to load a text-generation model using the pipeline function. My code searches for models on Hugging Face by keyword, filters for "text-generation", "transformers.js", and "onnx" tags, and attempts to load the resulting models. When I attempt to load certain models, an error with a numeric code (e.g., 3330359752) is thrown. The numeric code changes each time, suggesting it may not hold specific meaning.

Notably, it seems that smaller models load successfully, while larger models may consistently throw this error, though Iā€™m not entirely certain.

Models that loaded successfully:

Models that failed to load:

Reproduction

generator = await pipeline(
    "text-generation",
    "onnx-community/Llama-3.2-3B-Instruct",
    { device: "webgpu" }
  );
xenova commented 2 hours ago

While this might be an out-of-memory issues, the models have been tested and work in Node.js, so maybe a runtime error occurring for WebGPU. cc @guschmue