From 40002640eae5b8cff61e03465f4861653e83e74e Mon Sep 17 00:00:00 2001 From: Shen Xu Date: Wed, 8 Oct 2025 12:59:12 -0700 Subject: [PATCH] Read max context length from the correct ModelArgs field Summary: We should read from `max_context_len` for RoPE, `max_seq_len` represents input sequence length. Differential Revision: D84182698 --- examples/models/llama/static_attention.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/models/llama/static_attention.py b/examples/models/llama/static_attention.py index b42371dc090..95bae1b766a 100644 --- a/examples/models/llama/static_attention.py +++ b/examples/models/llama/static_attention.py @@ -259,7 +259,7 @@ def __init__( } rope = Rope(config) - freqs = rope.get_freqs(None, config.max_seq_len) + freqs = rope.get_freqs(None, config.max_context_len) self.freqs_cos = freqs[0].to(dtype) self.freqs_sin = freqs[1].to(dtype)