[New Model] support nemotron Audex (#4976)
Signed-off-by: Yuekai Zhang <zhangyuekai@foxmail.com> Signed-off-by: Yueqian Lin <linyueqian@outlook.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Yueqian Lin <linyueqian@outlook.com> Co-authored-by: Yueqian Lin <70319226+linyueqian@users.noreply.github.com>
This commit is contained in:
64 files changed
+7760
-39
No files matched your search
@@ -12,7 +12,7 @@ from vllm.sampling_params import RequestOutputKind, SamplingParams
|
||||
from vllm.transformers_utils.config import get_config, get_hf_file_to_dict
|
||||
from vllm.transformers_utils.repo_utils import file_or_path_exists
|
||||
|
||||
from vllm_omni.config.config_factory import StageConfigFactory
|
||||
from vllm_omni.config.config_factory import StageConfigFactory, with_trust_remote_code_override
|
||||
from vllm_omni.config.yaml_util import create_config, load_yaml_config, merge_configs
|
||||
from vllm_omni.diffusion.utils.hf_utils import _looks_like_dreamzero
|
||||
from vllm_omni.entrypoints.stage_utils import _to_dict
|
||||
@@ -103,12 +103,7 @@ def _filter_dict_like_object(obj: dict | Any) -> dict:
|
||||
return True
|
||||
return isinstance(
|
||||
value,
|
||||
(
|
||||
types.FunctionType,
|
||||
types.MethodType,
|
||||
types.BuiltinFunctionType,
|
||||
types.BuiltinMethodType,
|
||||
),
|
||||
types.FunctionType | types.MethodType | types.BuiltinFunctionType | types.BuiltinMethodType,
|
||||
)
|
||||
|
||||
result = {}
|
||||
@@ -193,10 +188,10 @@ def _convert_dataclasses_to_dict(obj: Any) -> Any:
|
||||
if callable(obj):
|
||||
return None
|
||||
# Handle lists and tuples (recurse into items)
|
||||
if isinstance(obj, (list, tuple)):
|
||||
if isinstance(obj, list | tuple):
|
||||
return type(obj)(_convert_dataclasses_to_dict(item) for item in obj if not callable(item))
|
||||
# Try to convert any dict-like object (has keys/values methods) to dict
|
||||
if hasattr(obj, "keys") and hasattr(obj, "values") and not isinstance(obj, (str, bytes)):
|
||||
if hasattr(obj, "keys") and hasattr(obj, "values") and not isinstance(obj, str | bytes):
|
||||
try:
|
||||
return _filter_dict_like_object(obj)
|
||||
except (TypeError, ValueError, AttributeError):
|
||||
@@ -315,7 +310,7 @@ def resolve_model_config_path(model: str) -> str:
|
||||
def load_stage_configs_from_model(
|
||||
model: str,
|
||||
*,
|
||||
trust_remote_code: bool,
|
||||
trust_remote_code: bool | None,
|
||||
base_engine_args: dict | None = None,
|
||||
deploy_config_path: str | None = None,
|
||||
stage_overrides: dict[str, dict[str, Any]] | None = None,
|
||||
@@ -349,7 +344,12 @@ def load_stage_configs_from_model(
|
||||
base_engine_args = {}
|
||||
|
||||
cli_overrides = _convert_dataclasses_to_dict(dict(base_engine_args))
|
||||
cli_overrides["trust_remote_code"] = trust_remote_code
|
||||
# A False inherited from the engine-args dump is the store_true flag's
|
||||
# default, not an explicit choice — drop it so only the tri-state
|
||||
# parameter below decides (see with_trust_remote_code_override).
|
||||
if not cli_overrides.get("trust_remote_code"):
|
||||
cli_overrides.pop("trust_remote_code", None)
|
||||
cli_overrides = with_trust_remote_code_override(cli_overrides, trust_remote_code)
|
||||
if stage_overrides:
|
||||
for stage_id_str, overrides in stage_overrides.items():
|
||||
for key, val in overrides.items():
|
||||
@@ -559,7 +559,7 @@ def load_and_resolve_stage_configs(
|
||||
stage_configs_path: str | None,
|
||||
kwargs: dict | None,
|
||||
*,
|
||||
trust_remote_code: bool,
|
||||
trust_remote_code: bool | None,
|
||||
default_stage_cfg_factory: Any = None,
|
||||
deploy_config_path: str | None = None,
|
||||
stage_overrides: dict[str, dict[str, Any]] | None = None,
|
||||
@@ -728,7 +728,7 @@ def filter_dataclass_kwargs(cls: Any, kwargs: dict) -> dict:
|
||||
if origin in (list, tuple, set):
|
||||
args = get_args(annotation)
|
||||
inner = args[0] if args else None
|
||||
if isinstance(value, (list, tuple, set)):
|
||||
if isinstance(value, list | tuple | set):
|
||||
return type(value)(_filter_value(v, inner) for v in value)
|
||||
return value
|
||||
|
||||
|
||||
Reference in new issue
Block a user