[Model] Use upstream GLM-5.3 and Qwen4-Exp configs and processor (#57387)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
866f02db8a
commit
e3cae8d2ac
+12
-1
@@ -108,6 +108,16 @@ HfOverrides = dict[str, Any] | Callable[[PreTrainedConfig], PreTrainedConfig]
|
||||
ModelImpl = Literal["auto", "vllm", "transformers", "terratorch"]
|
||||
LayerBlockType = Literal["attention", "linear_attention", "mamba"]
|
||||
|
||||
_ATTENTION_LAYER_TYPES = frozenset(
|
||||
{
|
||||
"full_attention",
|
||||
"deepseek_sparse_attention",
|
||||
"qwen_sparse_attention",
|
||||
}
|
||||
)
|
||||
"""`layer_types` spellings that consume a full attention KV cache. Sparse
|
||||
attention still caches every token, so it counts as attention here."""
|
||||
|
||||
_RUNNER_CONVERTS: dict[RunnerType, list[ConvertType]] = {
|
||||
"generate": [],
|
||||
"pooling": ["embed", "classify"],
|
||||
@@ -1718,7 +1728,8 @@ class ModelConfig:
|
||||
if layer_types_value is not None:
|
||||
if block_type == "attention":
|
||||
return sum(
|
||||
t == "full_attention" for t in layer_types_value[start:end]
|
||||
t in _ATTENTION_LAYER_TYPES
|
||||
for t in layer_types_value[start:end]
|
||||
)
|
||||
elif block_type == "linear_attention":
|
||||
return sum(
|
||||
|
||||
Reference in New Issue
Block a user