diff --git a/package-lock.json b/package-lock.json index 815be25..c0fd4a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "name": "malacca", "version": "0.0.0", "dependencies": { - "gpt-tokenizer": "^2.2.1", "hono": "^4.5.5" }, "devDependencies": { @@ -2338,15 +2337,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gpt-tokenizer": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/gpt-tokenizer/-/gpt-tokenizer-2.2.1.tgz", - "integrity": "sha512-JYvLWTpPtFGz7eS7uixHslv3L96zka0n18MlQeH5YVl5F6mNhssxzSBTeqwNfW8A0AQIMYEaOfbSr+MaoCUvpg==", - "license": "MIT", - "dependencies": { - "rfc4648": "^1.5.2" - } - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -3224,12 +3214,6 @@ "node": ">=0.10.0" } }, - "node_modules/rfc4648": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/rfc4648/-/rfc4648-1.5.3.tgz", - "integrity": "sha512-MjOWxM065+WswwnmNONOT+bD1nXzY9Km6u3kzvnx8F8/HXGZdz3T6e6vZJ8Q/RIMUSp/nxqjH3GwvJDy8ijeQQ==", - "license": "MIT" - }, "node_modules/rollup": { "version": "4.21.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", diff --git a/package.json b/package.json index 384010e..a5a4ad8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "wrangler": "^3.60.3" }, "dependencies": { - "gpt-tokenizer": "^2.2.1", "hono": "^4.5.5" } } diff --git a/src/index.ts b/src/index.ts index 819754e..daae7a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ import { Hono, Context } from 'hono' -import { encodeChat } from 'gpt-tokenizer' type Bindings = { MALACCA: AnalyticsEngineDataset, @@ -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) {