Open qaeu opened 4 months ago
Manually preprocessing IGNORE_STRINGS
into tokens to remove the 2nd encode call decreases duration by ~50%:
Full server action length: 1261
Tokenising length: 112
Full server action length: 884
Tokenising length: 134
Full server action length: 1056
Tokenising length: 183
Full server action length: 1047
Tokenising length: 131
Leaving as-is for now for ease of modification.
Edit: should consider preprocessing at build time.
Measured in ms, for
queryChatGPT()
andsetPreviousTokens()
.setPreviousTokens()
calls and awaits js-tiktoken functions sequentially.Testing using
Promise.all()
to resolve both function calls asynchronously increases duration by ~50%:Should test using the wasm tiktoken package.