mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-16 09:56:09 +08:00
[Bugfix] GGUF: fix AttributeError: 'PosixPath' object has no attribute 'startswith' (#21579)
Signed-off-by: Kebe <mail@kebe7jun.com>
This commit is contained in:
parent
8ed01e32f7
commit
7311f74468
@ -584,7 +584,7 @@ def get_pooling_config_name(pooling_name: str) -> Union[str, None]:
|
||||
|
||||
|
||||
@cache
|
||||
def get_sentence_transformer_tokenizer_config(model: str,
|
||||
def get_sentence_transformer_tokenizer_config(model: Union[str, Path],
|
||||
revision: Optional[str] = 'main'
|
||||
):
|
||||
"""
|
||||
@ -592,7 +592,7 @@ def get_sentence_transformer_tokenizer_config(model: str,
|
||||
given Sentence Transformer BERT model.
|
||||
|
||||
Parameters:
|
||||
- model (str): The name of the Sentence Transformer
|
||||
- model (str|Path): The name of the Sentence Transformer
|
||||
BERT model.
|
||||
- revision (str, optional): The revision of the m
|
||||
odel to use. Defaults to 'main'.
|
||||
@ -620,7 +620,7 @@ def get_sentence_transformer_tokenizer_config(model: str,
|
||||
if encoder_dict:
|
||||
break
|
||||
|
||||
if not encoder_dict and not model.startswith("/"):
|
||||
if not encoder_dict and not Path(model).is_absolute():
|
||||
try:
|
||||
# If model is on HuggingfaceHub, get the repo files
|
||||
repo_files = list_repo_files(model,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user