IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

LongRoPEScalingParams

LongRoPEScalingParams​

class max.nn.LongRoPEScalingParams(short_factor, long_factor, original_max_position, max_position_embeddings)

source

Bases: object

Parameters for LongRoPE scaling as used in Phi-3.5 models.

Parameters:

long_factor​

long_factor: list[float]

source

Scaling factors for long sequences (can be much larger).

max_position_embeddings​

max_position_embeddings: int

source

Current max position embeddings after scaling.

original_max_position​

original_max_position: int

source

Original max position embeddings the model was trained with.

short_factor​

short_factor: list[float]

source

Scaling factors for short sequences (typically close to 1.0).