Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/tokenizer-docstrings' into token…
Browse files Browse the repository at this point in the history
…izer-docstrings
  • Loading branch information
acatav committed Nov 2, 2023
2 parents 5e1ad0b + 167569f commit 511c596
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/canopy/tokenizer/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Tokenizer:
>>> from canopy.tokenizer import Tokenizer
>>> Tokenizer.initialize()
Then, you can init a tokenizer instance by calling Tokenizer() from anywhere in the code and use it:
Then, you can instantiate a tokenizer instance by calling Tokenizer() from anywhere in the code and use it:
>>> tokenizer = Tokenizer()
>>> tokenizer.tokenize("Hello world!")
['Hello', 'world', '!']
Expand Down Expand Up @@ -48,7 +48,7 @@ def initialize(cls,
Args:
tokenizer_class: The tokenizer class to use. Must be a subclass of BaseTokenizer. Defaults to OpenAITokenizer.
**kwargs: Keyword arguments to pass to the tokenizer class constructor.
**kwargs: Keyword arguments to pass to the underlying `Tokenizer` class constructor.
Examples:
Initialize the tokenizer with the default tokenizer class:
Expand All @@ -69,7 +69,7 @@ def initialize(cls,
... return sum([self.token_count(message) + 3 for message in messages])
>>> Tokenizer.initialize(MyTokenizer)
Then, you can init a tokenizer instance by calling Tokenizer() from anywhere in the code:
Then, you can instantiate a tokenizer instance by calling Tokenizer() from anywhere in the code:
>>> from canopy.tokenizer import Tokenizer
>>> tokenizer = Tokenizer()
Expand Down

0 comments on commit 511c596

Please sign in to comment.