From 447f91dbf1a8947ac90343447bfc7f279f10d98d Mon Sep 17 00:00:00 2001 From: Johannes Date: Tue, 2 Jul 2024 12:05:24 +0200 Subject: [PATCH] more `_serviceBrand` removal --- src/base/test/elements.test.tsx | 1 - src/base/test/renderer.test.tsx | 3 +-- src/base/tokenizer/cl100kBaseTokenizer.ts | 1 - src/base/tokenizer/tokenizer.ts | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/base/test/elements.test.tsx b/src/base/test/elements.test.tsx index 0802b20..c3dd06a 100644 --- a/src/base/test/elements.test.tsx +++ b/src/base/test/elements.test.tsx @@ -15,7 +15,6 @@ import { suite('PromptElements', () => { suite('TextChunk', () => { const tokenizer = new class TokenPerWordTokenizer implements ITokenizer { - _serviceBrand: undefined; baseTokensPerMessage = 0; baseTokensPerName = 0; baseTokensPerCompletion = 0; diff --git a/src/base/test/renderer.test.tsx b/src/base/test/renderer.test.tsx index 32bff41..a9747b0 100644 --- a/src/base/test/renderer.test.tsx +++ b/src/base/test/renderer.test.tsx @@ -98,7 +98,7 @@ suite('PromptRenderer', () => { "This late pivot means we don't have time to boil the ocean for the client deliverable.", }, ]); - assert.deepStrictEqual(res.tokenCount, 129 - BaseTokensPerCompletion); + assert.deepStrictEqual(res.tokenCount, 129 - BaseTokensPerCompletion); }); test('runs async prepare in parallel', async () => { @@ -910,7 +910,6 @@ LOW MED 00 01 02 03 04 05 06 07 08 09 const consumeRe = /consume=(\d+)/g; class FakeTokenizer implements ITokenizer { - _serviceBrand: undefined; baseTokensPerMessage = 0; baseTokensPerName = 0; baseTokensPerCompletion = 0; diff --git a/src/base/tokenizer/cl100kBaseTokenizer.ts b/src/base/tokenizer/cl100kBaseTokenizer.ts index e2de9e5..bba5193 100644 --- a/src/base/tokenizer/cl100kBaseTokenizer.ts +++ b/src/base/tokenizer/cl100kBaseTokenizer.ts @@ -13,7 +13,6 @@ import { ITokenizer } from './tokenizer'; * See https://github.com/microsoft/Tokenizer */ export class Cl100KBaseTokenizer implements ITokenizer { - declare readonly _serviceBrand: undefined; private _cl100kTokenizer: TikTokenizer | undefined; public readonly models = ['gpt-4', 'gpt-3.5-turbo', 'text-embedding-ada-002']; diff --git a/src/base/tokenizer/tokenizer.ts b/src/base/tokenizer/tokenizer.ts index d2777e7..e7b7106 100644 --- a/src/base/tokenizer/tokenizer.ts +++ b/src/base/tokenizer/tokenizer.ts @@ -23,7 +23,6 @@ export interface ITokenizer { } export class AnyTokenizer implements ITokenizer { - _serviceBrand: undefined; constructor(private countTokens: (text: string | LanguageModelChatMessage, token?: CancellationToken) => Thenable) { }