[Model] Extend NPU support for HunyuanImage3 Diffusion Model (#1689)
Signed-off-by: ElleElleWu <1608928702@qq.com> Signed-off-by: gcanlin <canlinguosdu@gmail.com> Co-authored-by: skf1999 <13234016272@163.com> Co-authored-by: Just-it <1161406585@qq.com> Co-authored-by: Semmer2 <semmer@live.cn> Co-authored-by: gcanlin <canlinguosdu@gmail.com>
This commit is contained in:
11 files changed
+395
-27
No files matched your search
@@ -463,11 +463,13 @@ class OmniDiffusionConfig:
|
||||
@property
|
||||
def is_moe(self) -> bool:
|
||||
num_experts = self.tf_model_config.get("num_experts", None)
|
||||
if not isinstance(num_experts, (list, tuple, int)):
|
||||
return False
|
||||
if isinstance(num_experts, int):
|
||||
return num_experts > 1
|
||||
return num_experts > 0
|
||||
|
||||
if isinstance(num_experts, (list, tuple)):
|
||||
return any(isinstance(n, int) and n > 1 for n in num_experts)
|
||||
return any(isinstance(n, int) and n > 0 for n in num_experts)
|
||||
|
||||
return False
|
||||
|
||||
|
||||
Reference in new issue
Block a user