Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
aecae6d0
authored
2023-11-15 10:32:23 +0000
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch '28594_usage_tracking' into 'master'
28594_usage_tracking See merge request
!80
2 parents
216d3b57
6f8d2d2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
index.js
index.js
View file @
aecae6d
...
...
@@ -192,7 +192,7 @@ async function runGPTTurbo(req, res) {
let
usage
=
{};
let
enc
=
null
;
try
{
enc
=
encoding
_for_m
odel
(
tiktokenModels
.
includes
(
currentModel
)
?
currentModel
:
'gpt-3.5-turbo'
);
enc
=
encoding
ForM
odel
(
tiktokenModels
.
includes
(
currentModel
)
?
currentModel
:
'gpt-3.5-turbo'
);
usage
.
prompt_tokens
=
(
enc
.
encode
(
query_prompt
)).
length
;
usage
.
completion_tokens
=
(
enc
.
encode
(
input
)).
length
;
usage
.
total_tokens
=
usage
.
prompt_tokens
+
usage
.
completion_tokens
;
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment