Update examples

This commit is contained in:
Tat Dat Duong
2023-11-15 23:57:20 +01:00
parent 32882f7ef2
commit 10302a2d90
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ async function encodingForModel(
}
async function main() {
const encodings = await encodingForModel("gpt-4");
const encodings = await encodingForModel("gpt-4-1106-preview");
const text = "function foo() { return 1; }";
const tokens = encodings.encode(text);
console.log(tokens);
+1 -1
View File
@@ -1,5 +1,5 @@
import assert from "node:assert";
import { getEncoding } from "../dist";
const enc = getEncoding("gpt2");
const enc = getEncoding("cl100k_base");
assert(enc.decode(enc.encode("hello world")) === "hello world");