File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/lighteval/models/vllm Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ class VLLMModelConfig(ModelConfig):
85
85
Attributes:
86
86
model_name (str):
87
87
HuggingFace Hub model ID or path to the model to load.
88
+ tokenizer (str | None):
89
+ HuggingFace Hub model ID or path to the tokenizer to load.
88
90
revision (str):
89
91
Git revision of the model. Defaults to "main".
90
92
dtype (str):
@@ -150,6 +152,7 @@ class VLLMModelConfig(ModelConfig):
150
152
"""
151
153
152
154
model_name : str
155
+ tokenizer : str | None = None
153
156
revision : str = "main" # revision of the model
154
157
dtype : str = "bfloat16"
155
158
tensor_parallel_size : PositiveInt = 1 # how many GPUs to use for tensor parallelism
@@ -289,7 +292,7 @@ def _create_auto_model(self, config: VLLMModelConfig) -> Optional[LLM]:
289
292
290
293
def _create_auto_tokenizer (self , config : VLLMModelConfig ):
291
294
tokenizer = get_tokenizer (
292
- config .model_name ,
295
+ config .tokenizer or config . model_name , # use HF tokenizer for non-HF models, like GGUF model.
293
296
tokenizer_mode = "auto" ,
294
297
trust_remote_code = config .trust_remote_code ,
295
298
revision = config .revision ,
You can’t perform that action at this time.
0 commit comments