Closed ghost closed 1 year ago
tried https://esm.sh/tiktoken
caught TypeError: B.__wbindgen_add_to_stack_pointer is not a function
at Module.L (tiktoken.bundle.mjs:1:3977853)
at <anonymous>:1:7
Hello @InterestingDarkness!
The setup for a browser is most likely determined by the way how you bundle the app / whether you bundle at all. For simplicity sake, it might be a better idea to use the accompanying js-tiktoken
package, which does not include any WASM binaries at all.
It works. Thank you!
import * as Tiktoken from 'https://cdn.skypack.dev/js-tiktoken?min'
const enc = Tiktoken.encodingForModel("gpt-4");
like that