Restore Qwen3 rope config fallback (#22739)
This commit is contained in:
@@ -316,8 +316,16 @@ class Qwen3DecoderLayer(nn.Module):
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.hidden_size = config.hidden_size
|
||||
rope_theta = config.rope_parameters["rope_theta"]
|
||||
rope_scaling = config.rope_parameters
|
||||
if (
|
||||
hasattr(config, "rope_parameters")
|
||||
and config.rope_parameters
|
||||
and "rope_theta" in config.rope_parameters
|
||||
):
|
||||
rope_theta = config.rope_parameters["rope_theta"]
|
||||
rope_scaling = config.rope_parameters
|
||||
else:
|
||||
rope_theta = getattr(config, "rope_theta", 1000000)
|
||||
rope_scaling = getattr(config, "rope_scaling", None)
|
||||
max_position_embeddings = getattr(config, "max_position_embeddings", 32768)
|
||||
head_dim = getattr(config, "head_dim", None)
|
||||
self.self_attn = Qwen3Attention(
|
||||
|
||||
Reference in New Issue
Block a user