Skip to content

Commit

Permalink
remove gpt-tokenizer
Browse files Browse the repository at this point in the history
Signed-off-by: Mengxin Liu <[email protected]>
  • Loading branch information
oilbeater committed Sep 10, 2024
1 parent 161e5bb commit a8d8405
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
16 changes: 0 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"wrangler": "^3.60.3"
},
"dependencies": {
"gpt-tokenizer": "^2.2.1",
"hono": "^4.5.5"
}
}
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Hono, Context } from 'hono'
import { encodeChat } from 'gpt-tokenizer'

type Bindings = {
MALACCA: AnalyticsEngineDataset,
Expand Down Expand Up @@ -40,7 +39,7 @@ async function handleChat(c: Context) {
return c.text('Internal Server Error', 500)
}
const decoder = new TextDecoder('utf-8');
let prompt_tokens = encodeChat(body['messages']).length;
let prompt_tokens = 0;
let completion_tokens = 0;

if (response.status == 200) {
Expand Down

0 comments on commit a8d8405

Please sign in to comment.