Skip to content

Commit

Permalink
New Anthropic tokenizer.json URL
Browse files Browse the repository at this point in the history
  • Loading branch information
vblagoje committed Nov 11, 2024
1 parent 1bc3940 commit 8189be3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion haystack/nodes/prompt/invocation_layer/anthropic_claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
# Taken from:
# https://github.com/anthropics/anthropic-sdk-python/blob/main/anthropic/tokenizer.py#L7
# This is a JSON config to load the tokenizer used for Anthropic Claude.
# Anthropic removed tokenizer.json from their repo (https://github.com/anthropics/anthropic-sdk-python/pull/726),
# we need to use the commit from the latest version of the SDK that still
# has it, i.e. 0.38.0 and commit hash 14afc93ffd809e60666a267763a57a328184c5e4.
CLAUDE_TOKENIZER_REMOTE_FILE = (
"https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/main/src/anthropic/tokenizer.json"
"https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/14afc93ffd809e60666a267763a57a328184c5e4/src/anthropic/tokenizer.json"
)


Expand Down

0 comments on commit 8189be3

Please sign in to comment.