Skip to content

Commit

Permalink
Document encoder's count() method [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Nov 2, 2024
1 parent bd004f2 commit 3af3bae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ $tokens= Encoding::named('cl100k_base')->load($source)->encode('Hello World!');
$tokens= Encoding::for('omni')->load($source)->encode('Hello World!');
```

Instead of *encode()*, you can use *count()* to count the number of tokens.

Embeddings
----------
To create an embedding for a given text, use https://platform.openai.com/docs/guides/embeddings/what-are-embeddings
Expand Down

0 comments on commit 3af3bae

Please sign in to comment.