Closed loretoparisi closed 1 year ago
Hello, you need to pass the output of enc.decode
to a TextDecoder.decode()
const { encoding_for_model } = require("@dqbd/tiktoken");
const textDecoder = new TextDecoder();
const enc = encoding_for_model("gpt-3.5-turbo", {
"<|im_start|>": 100264,
"<|im_end|>": 100265,
"<|im_sep|>": 100266,
});
console.log(
enc.encode("hello world"),
textDecoder.decode(enc.decode(enc.encode("hello world")))
);
Thanks it works using TextDecoder
Hello, I did
but I get