mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-02 06:22:48 +00:00
Update tests/test_litellm/litellm_core_utils/test_token_counter.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
parent
16ca7f4f96
commit
afbfbf3cae
@@ -213,10 +213,11 @@ def test_tokenizers():
|
||||
# llama2 may fall back to the tiktoken tokenizer when the HuggingFace
|
||||
# model hub is unreachable (e.g. in CI). In that case the count will
|
||||
# equal the openai count and the differentiation assertion is skipped.
|
||||
if openai_tokens != llama2_tokens:
|
||||
assert (
|
||||
llama2_tokens != llama3_tokens_1
|
||||
), "Token values are not different."
|
||||
if openai_tokens == llama2_tokens:
|
||||
pytest.skip("llama2 fell back to tiktoken (HF hub unreachable); skipping differentiation assertion")
|
||||
assert (
|
||||
llama2_tokens != llama3_tokens_1
|
||||
), "Token values are not different."
|
||||
|
||||
assert (
|
||||
llama3_tokens_1 == llama3_tokens_2
|
||||
|
||||
Reference in New Issue
Block a user