(modelName: string)
| 54 | const llamaAsyncEncoder = new LlamaAsyncEncoder(); |
| 55 | |
| 56 | function asyncEncoderForModel(modelName: string): AsyncEncoder { |
| 57 | // Temporary due to issues packaging the worker files |
| 58 | if (process.env.IS_BINARY) { |
| 59 | const encoding = encodingForModel(modelName); |
| 60 | return new NonWorkerAsyncEncoder(encoding); |
| 61 | } |
| 62 | |
| 63 | const modelType = autodetectTemplateType(modelName); |
| 64 | if (!modelType || modelType === "none") { |
| 65 | // Right now there is a problem packaging js-tiktoken in workers. Until then falling back |
| 66 | // Cannot find package 'js-tiktoken' imported from /Users/nate/gh/continuedev/continue/extensions/vscode/out/tiktokenWorkerPool.mjs |
| 67 | // return gptAsyncEncoder; |
| 68 | return llamaAsyncEncoder; |
| 69 | } |
| 70 | return llamaAsyncEncoder; |
| 71 | } |
| 72 | |
| 73 | function encodingForModel(modelName: string): Encoding { |
| 74 | const modelType = autodetectTemplateType(modelName); |
no test coverage detected