[feat][Ascend][Mindspore]: support model-impl of mindspore (#9234)

This commit is contained in:
Chen Haozhe
2025-11-19 09:17:47 +08:00
committed by GitHub
parent 0d2d687812
commit 6c2e5fcd91
9 changed files with 680 additions and 1 deletions
+3 -1
View File
@@ -99,7 +99,9 @@ def get_model_architecture(model_config: ModelConfig) -> Tuple[Type[nn.Module],
supported_archs = ModelRegistry.get_supported_archs()
is_native_supported = any(arch in supported_archs for arch in architectures)
if not is_native_supported or model_config.model_impl == ModelImpl.TRANSFORMERS:
if model_config.model_impl == ModelImpl.MINDSPORE:
architectures = ["MindSporeForCausalLM"]
elif not is_native_supported or model_config.model_impl == ModelImpl.TRANSFORMERS:
architectures = resolve_transformers_arch(model_config, architectures)
return ModelRegistry.resolve_model_cls(architectures)