6f8d2d2f by Jonille Arreglo

28594_usage_tracking

1 parent c1504d56
Showing 1 changed file with 1 additions and 1 deletions
...@@ -192,7 +192,7 @@ async function runGPTTurbo(req, res) { ...@@ -192,7 +192,7 @@ async function runGPTTurbo(req, res) {
192 let usage = {}; 192 let usage = {};
193 let enc = null; 193 let enc = null;
194 try { 194 try {
195 enc = encoding_for_model(tiktokenModels.includes(currentModel) ? currentModel : 'gpt-3.5-turbo'); 195 enc = encodingForModel(tiktokenModels.includes(currentModel) ? currentModel : 'gpt-3.5-turbo');
196 usage.prompt_tokens = (enc.encode(query_prompt)).length; 196 usage.prompt_tokens = (enc.encode(query_prompt)).length;
197 usage.completion_tokens = (enc.encode(input)).length; 197 usage.completion_tokens = (enc.encode(input)).length;
198 usage.total_tokens = usage.prompt_tokens + usage.completion_tokens; 198 usage.total_tokens = usage.prompt_tokens + usage.completion_tokens;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!