Giter Club home page Giter Club logo

Comments (16)

dmb0058 avatar dmb0058 commented on July 19, 2024 2

This seems identical to the issue I have with HNSWlib-node.
It might be coincidental, but in case this is a langchainjs issue, not faiss, see:

langchain-ai/langchainjs#943
langchain-ai/langchainjs#1764

from faiss-node.

ewfian avatar ewfian commented on July 19, 2024 1

@abgupta99 Thank you for the issue, I will try to reproduce and fix it

from faiss-node.

ewfian avatar ewfian commented on July 19, 2024 1

The new version was released, To use faiss-node in AWS, you can download faiss-node-vX.X.X-aws-x64.zip from release. and upload to AWS as a layer.
BTW. if you are using the faiss-node as layer, do NOT install faiss-node as npm package in your AWS Function, see the demo here: langchain-ai/langchainjs#1930 (comment)

from faiss-node.

dmb0058 avatar dmb0058 commented on July 19, 2024

Spent the day building test cases for this, and it's the same langchainjs error.

Most approaches end up with:

"Could not import faiss-node. Please install faiss-node as a dependency with, e.g. npm install -S faiss-node.\n\nError: libgomp.so.1: cannot open shared object file: No such file or directory"

Currently I see that there is any route to using langchain with either faiss or hnswnlib on AWS Lambda.

from faiss-node.

manuel-84 avatar manuel-84 commented on July 19, 2024

Having similar problem when deployed on Vercel, while on local dev is working fine

Could not import faiss-node. Please install faiss-node as a dependency with, e.g. npm install -S faiss-node.\n\nError: libgomp.so.1: cannot open shared object file: No such file or directory","stack":"

from faiss-node.

ewfian avatar ewfian commented on July 19, 2024

I have create a build for AWS Lambda in #30

And is was works on my side:
image

It has not been released yet, but you can try the version I built manually below:
faiss-node-v0.2.2-aws-x64.zip

For other projects, please replace with the files under the path below:
faiss-node-v0.2.2-aws-x64.zip/node_modules/faiss-node/build/Release

from faiss-node.

dmb0058 avatar dmb0058 commented on July 19, 2024

Hi,

No luck my side Iā€™m afraid: still missing libgomp.so.1:

{
  "errorType": "Error",
  "errorMessage": "Could not import faiss-node. Please install faiss-node as a dependency with, e.g. `npm install -S faiss-node`.\n\nError: libgomp.so.1: cannot open shared object file: No such file or directory",
  "trace": [
    "Error: Could not import faiss-node. Please install faiss-node as a dependency with, e.g. `npm install -S faiss-node`.",
    "",
    "Error: libgomp.so.1: cannot open shared object file: No such file or directory",
    "    at FaissStore.importFaiss (/opt/nodejs/node_modules/langchain/dist/vectorstores/faiss.cjs:237:19)",
    "    at async readIndex (/opt/nodejs/node_modules/langchain/dist/vectorstores/faiss.cjs:141:37)",
    "    at async Promise.all (index 1)",
    "    at async FaissStore.load (/opt/nodejs/node_modules/langchain/dist/vectorstores/faiss.cjs:144:51)",
    "    at async query (/var/task/index.js:112:20)",
    "    at async exports.handler (/var/task/index.js:20:9)"
  ]
}

Also, after adding the Faiss layer I can't add anything much else as it's far too big:

Layers consume more than the available size of 262144000 bytes

David

from faiss-node.

ewfian avatar ewfian commented on July 19, 2024

@dmb0058 I want to know whether it works properly if you directly upload the zip(faiss-node-v0.2.2-aws-x64.zip) I provided above to AWS.

Please confirm that you have replaced the files(node_modules/faiss-node/build/Release) in my zip above to the zip you finally want to upload to AWS.

I also made a demo for langchain here: langchain-ai/langchainjs#1930 (comment)
You can try to upload this demo directly to AWS.

from faiss-node.

dmb0058 avatar dmb0058 commented on July 19, 2024

Yes, the demo zip (faiss-node-v0.2.2-aws-x64.zip) runs when I upload it as a lambda and gives the same results as you show above.

I can't create a layer though, so can't use this in practice:

 aws lambda publish-layer-version --layer-name my-faiss-layer \
        --description "My Faiss layer" \
        --license-info "MIT" \
        --zip-file fileb://my-faiss-node.zip \
        --compatible-runtimes nodejs18.x \
        --compatible-architectures "x86_64"
An error occurred (RequestEntityTooLargeException) when calling the PublishLayerVersion operation: Request must be smaller than 70167211 bytes for the PublishLayerVersion operation

from faiss-node.

ewfian avatar ewfian commented on July 19, 2024

@dmb0058 Can you reduce the size of the zip to make it meet the limit first.
The prebuilt binaries is too large under Linux was also mentioned in your previous issue(#26).
The binaries for AWS have shrunk a lot. The zip containing faiss-node is only 7.5MB. And the zip containing langchain and faiss-node has 15.5MB. Which is far less than the limit of AWS. Please identify what content takes up space and try to reduce it.

from faiss-node.

dmb0058 avatar dmb0058 commented on July 19, 2024

from faiss-node.

ewfian avatar ewfian commented on July 19, 2024

@dmb0058 You can also try this demo langchain-ai/langchainjs#1930 (comment)

from faiss-node.

rishi-raj-jain avatar rishi-raj-jain commented on July 19, 2024

This now works flawlessly with Fly.io, I had made a cool demo before and now I don't need to copy the zip folder over.

Thank you for maintaining and improving this šŸ™šŸ»

from faiss-node.

rishi-raj-jain avatar rishi-raj-jain commented on July 19, 2024

@ewfian

I'm happy to pay you one time 30$ as the best I can for now. Can you share a buymeacoffee/paypal/stripe link? Thanks!

from faiss-node.

rishi-raj-jain avatar rishi-raj-jain commented on July 19, 2024

This is totally out of my respect for your work.

from faiss-node.

afsaints avatar afsaints commented on July 19, 2024

The newer version is still cannot get through on the lambda layers, still having the same error which is
{
"errorType": "Error",
"errorMessage": "Could not import faiss-node. Please install faiss-node as a dependency with, e.g. npm install -S faiss-node.\n\nError: libgomp.so.1: cannot open shared object file: No such file or directory",
"trace": [
"Error: Could not import faiss-node. Please install faiss-node as a dependency with, e.g. npm install -S faiss-node.",
"",
"Error: libgomp.so.1: cannot open shared object file: No such file or directory",
" at FaissStore.importFaiss (/opt/nodejs/node_modules/langchain/dist/vectorstores/faiss.cjs:237:19)",
" at async readIndex (/opt/nodejs/node_modules/langchain/dist/vectorstores/faiss.cjs:141:37)",
" at async Promise.all (index 1)",
" at async FaissStore.load (/opt/nodejs/node_modules/langchain/dist/vectorstores/faiss.cjs:144:51)",
" at async query (/var/task/index.js:112:20)",
" at async exports.handler (/var/task/index.js:20:9)"
]
}

from faiss-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.