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: fixed bug in claude3 tokenizer #194

Merged
merged 2 commits into from
Dec 2, 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
3 changes: 2 additions & 1 deletion aidial_adapter_bedrock/dial_api/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ async def _get_bucket(self, session: aiohttp.ClientSession) -> Bucket:
headers=self.auth_headers,
) as response:
response.raise_for_status()
self.bucket = await response.json()
self.bucket = bucket = await response.json()
log.debug(f"bucket: {self.bucket}")
return bucket

return self.bucket

Expand Down
4 changes: 2 additions & 2 deletions aidial_adapter_bedrock/llm/model/claude/v3/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def _tokenize_tool_system_message(
):
return 294 if tool_choice == "auto" else 261
case (
ChatCompletionDeployment.ANTHROPIC_CLAUDE_V3_5_SONNET_V2,
ChatCompletionDeployment.ANTHROPIC_CLAUDE_V3_5_SONNET_V2_US,
ChatCompletionDeployment.ANTHROPIC_CLAUDE_V3_5_SONNET_V2
| ChatCompletionDeployment.ANTHROPIC_CLAUDE_V3_5_SONNET_V2_US
):
return 346 if tool_choice == "auto" else 313
case (
Expand Down
12 changes: 7 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pytest-dotenv = "^0.5.2"
pytest-xdist = "^3.5.0"

[tool.poetry.group.lint.dependencies]
pyright = "1.1.324"
pyright = "1.1.389"
black = "24.3.0"
isort = "5.12.0"
autoflake = "2.2.0"
Expand Down
Loading