Skip to content

Commit

Permalink
refactor: Add specific max token values to embedding models
Browse files Browse the repository at this point in the history
  • Loading branch information
dexters1 committed Jan 23, 2025
1 parent 6d5679f commit 7dea1d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ def __init__(
api_key: str = None,
endpoint: str = None,
api_version: str = None,
max_tokens: int = float("inf"),
max_tokens: int = 512,
):
self.api_key = api_key
self.endpoint = endpoint
self.api_version = api_version
# TODO: Add or remove provider info
self.provider = provider
self.model = model
self.dimensions = dimensions
Expand Down
2 changes: 1 addition & 1 deletion cognee/infrastructure/llm/tokenizer/Gemini/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class GeminiTokenizer(TokenizerInterface):
def __init__(
self,
model: str,
max_tokens: int = float("inf"),
max_tokens: int = 3072,
):
self.model = model
self.max_tokens = max_tokens
Expand Down
2 changes: 1 addition & 1 deletion cognee/infrastructure/llm/tokenizer/HuggingFace/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class HuggingFaceTokenizer(TokenizerInterface):
def __init__(
self,
model: str,
max_tokens: int = float("inf"),
max_tokens: int = 512,
):
self.model = model
self.max_tokens = max_tokens
Expand Down
2 changes: 1 addition & 1 deletion cognee/infrastructure/llm/tokenizer/TikToken/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TikTokenTokenizer(TokenizerInterface):
def __init__(
self,
model: str,
max_tokens: int = float("inf"),
max_tokens: int = 8191,
):
self.model = model
self.max_tokens = max_tokens
Expand Down

0 comments on commit 7dea1d5

Please sign in to comment.