Skip to content

Commit 2173f40

Browse files
kebe7junepwalsh
authored andcommitted
[Bugfix] GGUF: fix AttributeError: 'PosixPath' object has no attribute 'startswith' (vllm-project#21579)
Signed-off-by: Kebe <mail@kebe7jun.com>
1 parent 4b5bc69 commit 2173f40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vllm/transformers_utils/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,15 @@ def get_pooling_config_name(pooling_name: str) -> Union[str, None]:
584584

585585

586586
@cache
587-
def get_sentence_transformer_tokenizer_config(model: str,
587+
def get_sentence_transformer_tokenizer_config(model: Union[str, Path],
588588
revision: Optional[str] = 'main'
589589
):
590590
"""
591591
Returns the tokenization configuration dictionary for a
592592
given Sentence Transformer BERT model.
593593
594594
Parameters:
595-
- model (str): The name of the Sentence Transformer
595+
- model (str|Path): The name of the Sentence Transformer
596596
BERT model.
597597
- revision (str, optional): The revision of the m
598598
odel to use. Defaults to 'main'.
@@ -620,7 +620,7 @@ def get_sentence_transformer_tokenizer_config(model: str,
620620
if encoder_dict:
621621
break
622622

623-
if not encoder_dict and not model.startswith("/"):
623+
if not encoder_dict and not Path(model).is_absolute():
624624
try:
625625
# If model is on HuggingfaceHub, get the repo files
626626
repo_files = list_repo_files(model,

0 commit comments

Comments
 (0)