Anush008 / fastembed-js

Library to generate vector embeddings in NodeJS
https://www.npmjs.com/package/fastembed/
MIT License
64 stars 5 forks source link

@anush008/tokenizers does not support Linux-ARM #15

Closed elkay closed 2 months ago

elkay commented 5 months ago

Without ARM support, fastembed-js won't run on newer AWS t4g EC2 instances. Runs fine on x86 instances.

Error: Cannot find module '@anush008/tokenizers-linux-arm64-gnu'

Any thoughts on a way around this?

Anush008 commented 5 months ago

Hi @elkay. I'm working on a prototype that you might find interesting.

Can you try

import { TextEmbedding, EmbeddingModel } from 'fasterembed'

const model = new TextEmbedding(EmbeddingModel.AllMiniLML6V2);

let documents = [
    "passage: Hello, World!",
    "query: Hello, World!",
    "passage: This is an example passage.",
    // You can leave out the prefix but it's recommended
    "fastembed-js is licensed under MIT"
  ];

const embeddings = model.embed(documents, 2);

please?

Anush008 commented 5 months ago

After installing using

npm install fasterembed
Anush008 commented 5 months ago

Oh bummer.

Supports the following architectures.

https://github.com/Anush008/fasterembed/tree/main/npm

elkay commented 5 months ago

Oh bummer.

Supports the following architectures.

https://github.com/Anush008/fasterembed/tree/main/npm

Yeah, that's this issue I was reporting haha. No Linux ARM. So I guess no workaround right now?

Anush008 commented 5 months ago

If I remember correctly, I removed arm64-linux because it was failing the Fasterembed unit test.

I'll try if I can include it back.

elkay commented 5 months ago

Ok cool, thanks! :-) The AWS t4g offerings are their modern EC2 offerings and both cost less and outperform their predecessors, so it would be great to be able to migrate my project over to them.

elkay commented 5 months ago

Hey just an FYI, when I see builds for those servers it's usually "aarch64" support. Not sure if there is a difference, maybe not, but thought I would clarify.

Anush008 commented 2 months ago

Closing since stale.