Skip to content

Commit

Permalink
README.
Browse files Browse the repository at this point in the history
  • Loading branch information
belladoreai committed Mar 24, 2024
1 parent 80d90d8 commit d115a83
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ Alternative: Load as ES6 module with `<script>` tags in your HTML
<script type="module" src="https://belladoreai.github.io/llama-tokenizer-js/llama-tokenizer.js"></script>
```

Alternative: for TypeScript projects, imports [should](https://github.com/belladoreai/llama-tokenizer-js/issues/12#issuecomment-1790073415) work now with the `types.d.ts` file, but please file an issue if I need to change something.
Alternative: for CommonJS projects this should work:

Alternative: for CommonJS projects, [should](https://github.com/belladoreai/llama-tokenizer-js/issues/10) work with `const llamaTokenizer = await import('llama-tokenizer-js');`
```
async function main() {
const llamaTokenizer=await import('llama-tokenizer-js')
console.log(llamaTokenizer.default.encode("Hello world!"))
}
main();
```

TypeScript support has been added (please file an issue if there are still TypeScript problems with this).

## Usage

Expand Down

0 comments on commit d115a83

Please sign in to comment.