handling incomplete rope_scaling config ci after transformers upgrade (#14784)
This commit is contained in:
@@ -2704,6 +2704,12 @@ class DeepseekV2DecoderLayer(nn.Module):
|
|||||||
self.config = config
|
self.config = config
|
||||||
rope_theta = getattr(config, "rope_theta", 10000)
|
rope_theta = getattr(config, "rope_theta", 10000)
|
||||||
rope_scaling = getattr(config, "rope_scaling", None)
|
rope_scaling = getattr(config, "rope_scaling", None)
|
||||||
|
if rope_scaling is not None:
|
||||||
|
# In transformers 5.0.0rc0+, rope_theta and rope_type are also included in rope_scaling.
|
||||||
|
# Therefore, if rope_scaling contains only these two keys,
|
||||||
|
# it effectively means there are no special rope_scaling parameters.
|
||||||
|
if set(rope_scaling.keys()) <= {"rope_theta", "rope_type"}:
|
||||||
|
rope_scaling = None
|
||||||
max_position_embeddings = getattr(config, "max_position_embeddings", 8192)
|
max_position_embeddings = getattr(config, "max_position_embeddings", 8192)
|
||||||
self.speculative_algorithm = SpeculativeAlgorithm.from_string(
|
self.speculative_algorithm = SpeculativeAlgorithm.from_string(
|
||||||
get_global_server_args().speculative_algorithm
|
get_global_server_args().speculative_algorithm
|
||||||
|
|||||||
Reference in New Issue
Block a user