External dataset (#1497)
* perf: read rawText and chunk code * perf: read raw text * perf: read rawtext * perf: token count * log
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* Only the token of gpt-3.5-turbo is used */
|
||||
import { Tiktoken } from 'js-tiktoken/lite';
|
||||
import encodingJson from './cl100k_base.json';
|
||||
import { Tiktoken } from 'fastgpt-js-tiktoken/lite';
|
||||
import cl100k_base from './cl100k_base.json';
|
||||
import {
|
||||
ChatCompletionMessageParam,
|
||||
ChatCompletionContentPart,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
import { ChatCompletionRequestMessageRoleEnum } from '@fastgpt/global/core/ai/constants';
|
||||
import { parentPort } from 'worker_threads';
|
||||
|
||||
const enc = new Tiktoken(encodingJson);
|
||||
const enc = new Tiktoken(cl100k_base);
|
||||
|
||||
/* count messages tokens */
|
||||
parentPort?.on(
|
||||
|
||||
Reference in New Issue
Block a user