You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, we're getting the following stack trace of this unhandled exception:
Error: recursive use of an object detected which would lead to unsafe aliasing in rust
File "/app/node_modules/.pnpm/@[email protected]/node_modules/@dqbd/tiktoken/tiktoken_bg.cjs", line 432, col 11, in module.exports.__wbindgen_throw
throw new Error(getStringFromWasm0(arg0, arg1));
File "wasm://wasm/01569aca:wasm-function[1197]:0xb3cba"
File "wasm://wasm/01569aca:wasm-function[1218]:0xb3dcb"
File "wasm://wasm/01569aca:wasm-function[456]:0x9c989"
File "/app/node_modules/.pnpm/@[email protected]/node_modules/@dqbd/tiktoken/tiktoken_bg.cjs", line 203, col 44, in TiktokenFinalization
: new FinalizationRegistry(ptr => wasm.__wbg_tiktoken_free(ptr >>> 0));
File "<anonymous>", in FinalizationRegistry.cleanupSome
import{encoding_for_model}from"@dqbd/tiktoken";import{TiktokenModel}from"@dqbd/tiktoken";// This function calculates the number of tokens in a text string using GPT-3.5-turbo modelexportfunctionnumTokensFromString(message: string,model: string): number{constencoder=encoding_for_model(modelasTiktokenModel);// Encode the message into tokensconsttokens=encoder.encode(message);// Free the encoder resources after useencoder.free();// Return the number of tokensreturntokens.length;}
Any clues what this might be related to?
The text was updated successfully, but these errors were encountered:
Hey, we're getting the following stack trace of this unhandled exception:
We use tiktoken (
@dqbd/[email protected]
) in our project like so:Any clues what this might be related to?
The text was updated successfully, but these errors were encountered: