Skip to content

Commit

Permalink
fix max token limit and tokenizer in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-risch committed Dec 28, 2023
1 parent a02aafb commit 5ad8ecf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/prompt/invocation_layer/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_openai_token_limit_warning(mock_openai_tokenizer, caplog):
@pytest.mark.parametrize(
"model_name,max_tokens_limit",
[
("gpt-3.5-turbo-instruct", 4097),
("gpt-3.5-turbo-instruct", 4096),
("gpt-3.5-turbo", 4096),
("gpt-3.5-turbo-16k", 16384),
("gpt-4-32k", 32768),
Expand All @@ -76,7 +76,7 @@ def test_openai_token_limit_warning_not_triggered(caplog, mock_openai_tokenizer,
@pytest.mark.parametrize(
"model_name,max_tokens_limit",
[
("gpt-3.5-turbo-instruct", 4097),
("gpt-3.5-turbo-instruct", 4096),
("gpt-3.5-turbo", 4096),
("gpt-3.5-turbo-16k", 16384),
("gpt-4-32k", 32768),
Expand Down
4 changes: 2 additions & 2 deletions test/utils/test_openai_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_openai_text_completion_tokenization_details_gpt_default():
@pytest.mark.unit
def test_openai_text_completion_tokenization_details_gpt_davinci():
tokenizer_name, max_tokens_limit = _openai_text_completion_tokenization_details(model_name="gpt-3.5-turbo-instruct")
assert tokenizer_name == "p50k_base"
assert max_tokens_limit == 4097
assert tokenizer_name == "cl100k_base"
assert max_tokens_limit == 4096


@pytest.mark.unit
Expand Down

0 comments on commit 5ad8ecf

Please sign in to comment.