-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Fix parameter name in
get_tokenizer
(#4107)
- Loading branch information
1 parent
cf29b7e
commit a74dee9
Showing
2 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
from transformers import PreTrainedTokenizerBase | ||
|
||
from vllm.transformers_utils.tokenizer import get_tokenizer | ||
|
||
TOKENIZER_NAMES = [ | ||
"facebook/opt-125m", | ||
"gpt2", | ||
] | ||
|
||
|
||
@pytest.mark.parametrize("tokenizer_name", TOKENIZER_NAMES) | ||
def test_tokenizer_revision(tokenizer_name: str): | ||
# Assume that "main" branch always exists | ||
tokenizer = get_tokenizer(tokenizer_name, revision="main") | ||
assert isinstance(tokenizer, PreTrainedTokenizerBase) | ||
|
||
# Assume that "never" branch always does not exist | ||
with pytest.raises(OSError, match='not a valid git identifier'): | ||
get_tokenizer(tokenizer_name, revision="never") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters