We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfc409a commit 5b67d01Copy full SHA for 5b67d01
mergekit/moe/common.py
@@ -76,11 +76,19 @@ def copy_tensor_out(
76
clone: bool = False,
77
):
78
out_tensor_name = output_name or weight_info.name
79
+ aliases = weight_info.aliases or []
80
+ if not weight_info.optional:
81
+ aliases += weight_info.tied_names or []
82
try:
- tensor = loader.get_tensor(weight_info.name, aliases=weight_info.aliases)
83
+ tensor = loader.get_tensor(
84
+ weight_info.name,
85
+ aliases=aliases,
86
+ )
87
except KeyError:
88
tensor = None
- if tensor is None and not weight_info.optional:
89
+ if tensor is None:
90
+ if weight_info.optional:
91
+ return
92
logging.error(f"Missing weight: {weight_info.name} / {out_tensor_name}")
93
raise KeyError(out_tensor_name)
94
0 commit comments