Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/sglang/srt/models/deepseek_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,12 @@ def __init__(
self.config = config
rope_theta = getattr(config, "rope_theta", 10000)
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"}:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it compatible with old transformers?

rope_scaling = None
max_position_embeddings = getattr(config, "max_position_embeddings", 8192)
self.speculative_algorithm = SpeculativeAlgorithm.from_string(
get_global_server_args().speculative_algorithm
Expand Down
Loading