Closed aliuq closed 1 year ago
Hello, I assume the intent is to load tiktoken library in a different non-Node / Bun environment. If that is the case, #12 should most likely address your issues.
Hello
I found that a new init.js
file has been added to the submission history.
I am using it in Cloudflare Workers and importing it from the dist/web
. I noticed that you are planning to support Cloudflare Workers. However, I have tried several ways to import the file, but none of them have worked well. When I tried to import it using the import
statement, I received a script_too_large
error. When I tried to use a fetch
request, I received a WebAssembly.instantiate(): BufferSource argument is empty
error.
Regarding BufferSource
argument is empty: It might be possible that you've forgotten to obtain the arrayBuffer
from the fetch request.
Regardless, AFAIK Cloudflare Workers only support 1 MB in the free tier, whereas the WASM binary with the embeddings is 1.7 MB gzipped. Currently still investigating the API, but if you wish, you can build a version of tiktoken
without inlined ranks by passing --no-default-features
in wasm-pack
. This will be addressed in the next upcoming version.
Hello, a new version (1.0.0) has been released, which should introduce a much smaller WASM binary, especially useful for edge runtimes @aliuq
Sorry, I'm not very familiar with Rust. Relation target is
web
andno-modules