Open haibh-wanosoft opened 12 months ago
@dqbd Can you help me? thanks you.
we have the same issue with lambda and node 18, Can you help please?
Hello! Sorry for the delay. The code is highly dependent on the way how your lambda function is deployed. You might want to initialise the WASM and the library manually, similarly as seen in https://github.com/dqbd/tiktoken#vercel-edge-runtime
Alternatively, consider using js-tiktoken
instead, which is a pure JS port of @dqbd/tiktoken
without WASM dependencies.
I'm using the @dqbd/tiktoken library to count tokens in a text passage. When I deploy it on a Node.js 18 AWS EC2 instance, it works fine. However, when I deploy the library on an AWS Lambda function with TypeScript, it throws an error.
Code:
Error