huggingface/transformers.js

`onnx-community/gte-multilingual-base` Unknown model class "new"

Opened this issue · 1 comments

System Info

tranformers: v3.0.0-alpha.15
node: v18.20.3

MacOS M1 Sonoma 14.5

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

The model run fine (apparently) but running it warns us and invites us to remind an issue, so here I am. The issue is:

Unknown model class "new", attempting to construct from base class.
Model type for 'new' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.
dtype not specified for "model". Using the default dtype (fp32) for this device (cpu)

Reproduction

import { pipeline } from '@huggingface/transformers';

const run = async () => {
  const model = 'onnx-community/gte-multilingual-base';
  const extractor = await pipeline('feature-extraction', model, { pooling: 'mean', normalize: true });

  const texts = ['Hello world.', 'Example sentence.'];
  const embeddings = await extractor(texts );
  console.log(embeddings);
}

run();

🔴 As an addition this model DOES NOT work with latest v2

TypeError [ERR_WORKER_PATH]: The worker script or module filename must be an absolute path or a relative path starting with './' or '../'. Received "blob:nodedata:91680872-f3a8-4e5c-b7c4-809dc939da15"
    at new NodeError (node:internal/errors:405:5)
    at new Worker (node:internal/worker:179:15)
    at Object.yc (/***/node_modules/onnxruntime-web/dist/ort-web.node.js:6:7890)
    at Object.Cc (/***/node_modules/onnxruntime-web/dist/ort-web.node.js:6:7948)
    at lt (/***node_modules/onnxruntime-web/dist/ort-web.node.js:6:5690)
    at Et (/***/node_modules/onnxruntime-web/dist/ort-web.node.js:6:9720)
    at wasm://wasm/025ff5d6:wasm-function[10917]:0x7f0507
    at wasm://wasm/025ff5d6:wasm-function[1580]:0xf3ecb
    at wasm://wasm/025ff5d6:wasm-function[2786]:0x1d31ee
    at wasm://wasm/025ff5d6:wasm-function[5903]:0x49713d {
  code: 'ERR_WORKER_PATH'
}