Convert formatting to use ruff instead of yapf + isort (#26247)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -7,26 +7,25 @@ from typing import Optional, Union
|
||||
import pytest
|
||||
from transformers import PretrainedConfig
|
||||
|
||||
from vllm.transformers_utils.config import (get_config_parser,
|
||||
register_config_parser)
|
||||
from vllm.transformers_utils.config import get_config_parser, register_config_parser
|
||||
from vllm.transformers_utils.config_parser_base import ConfigParserBase
|
||||
|
||||
|
||||
@register_config_parser("custom_config_parser")
|
||||
class CustomConfigParser(ConfigParserBase):
|
||||
|
||||
def parse(self,
|
||||
model: Union[str, Path],
|
||||
trust_remote_code: bool,
|
||||
revision: Optional[str] = None,
|
||||
code_revision: Optional[str] = None,
|
||||
**kwargs) -> tuple[dict, PretrainedConfig]:
|
||||
def parse(
|
||||
self,
|
||||
model: Union[str, Path],
|
||||
trust_remote_code: bool,
|
||||
revision: Optional[str] = None,
|
||||
code_revision: Optional[str] = None,
|
||||
**kwargs,
|
||||
) -> tuple[dict, PretrainedConfig]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def test_register_config_parser():
|
||||
assert isinstance(get_config_parser("custom_config_parser"),
|
||||
CustomConfigParser)
|
||||
assert isinstance(get_config_parser("custom_config_parser"), CustomConfigParser)
|
||||
|
||||
|
||||
def test_invalid_config_parser():
|
||||
|
||||
Reference in New Issue
Block a user