mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 20:00:15 +01:00
chore(.gitignore): add client/public/images/ to ignore list (#417)
refactor(chatgpt-client.js): free encoder memory after use feat(chatgpt-client.tokens.js): add script to test memory usage of ChatGPTClient
This commit is contained in:
parent
4705975e59
commit
7fbf27c5aa
3 changed files with 91 additions and 0 deletions
|
|
@ -81,6 +81,7 @@ const askClient = async ({
|
|||
|
||||
try {
|
||||
usage.completion_tokens = (enc.encode(res.response)).length;
|
||||
enc.free();
|
||||
usage.total_tokens = usage.prompt_tokens + usage.completion_tokens;
|
||||
res.usage = usage;
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue