Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: initialize encodings array in parts #63

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
Expand All @@ -41,7 +41,7 @@ jobs:
if: github.actor != 'github-actions[bot]' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/beta')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ In this example, an Error is thrown, because the input text contains a disallowe

Running the unit tests and verifying the test cases helps maintain consistency between the library and the original Python implementation.

### Model Information

`gpt-tokenizer` provides comprehensive data about all OpenAI models through the `models` export from [`gpt-tokenizer/models`](./src/models.ts). This includes detailed information about context windows, costs, training data cutoffs, and deprecation status.

The data is regularly maintained to match OpenAI's official documentation. Contributions to keep this data up-to-date are welcome - if you notice any discrepancies or have updates, please feel free to open a PR.

## [Benchmarks](https://l8j6fv.csb.app/)

Since version 2.4.0, `gpt-tokenizer` is the fastest tokenizer implementation available on NPM. It's even faster than the available WASM/node binding implementations.
Expand Down
10 changes: 5 additions & 5 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"profile": "yarn tsc && node --inspect dist/benchmarkWorker.js --run"
},
"devDependencies": {
"@types/node": "^22.5.5",
"@types/node": "^22.8.7",
"chalk": "^5.3.0",
"cli-table3": "^0.6.5",
"inquirer": "^11.0.2",
"typescript": "^5.6.2"
"inquirer": "^12.0.1",
"typescript": "^5.6.3"
},
"dependencies": {
"gpt-3-encoder": "^1.1.4",
"gpt-tokenizer": "^2.4.0",
"gpt-tokenizer": "2.2.3",
"gpt3-tokenizer": "^1.1.5",
"js-tiktoken": "^1.0.15",
"tiktoken": "^1.0.16",
"tiktoken": "^1.0.17",
"tiktoken-node": "^0.0.7"
}
}
Loading
Loading