From b43f0983c80a955ba82df552f66df8b76f72df4b Mon Sep 17 00:00:00 2001 From: kingbri <8082010+kingbri1@users.noreply.github.com> Date: Mon, 28 Apr 2025 14:07:32 -0400 Subject: [PATCH] Model: Fix max_seq_len fallbacks The rope alpha calculation caused an error if max seq len isn't provided. This is because the model's max sequence length was not stored as the target for alpha calculation. Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com> --- backends/exllamav2/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backends/exllamav2/model.py b/backends/exllamav2/model.py index d1d364f..b9552b2 100644 --- a/backends/exllamav2/model.py +++ b/backends/exllamav2/model.py @@ -237,7 +237,8 @@ class ExllamaV2Container(BaseModelContainer): base_seq_len = self.config.max_seq_len # Set the target seq len if present - target_seq_len = kwargs.get("max_seq_len") + # Fallback to base_seq_len if not provided + target_seq_len = unwrap(kwargs.get("max_seq_len"), base_seq_len) # Set the rope scale self.config.scale_pos_emb = unwrap(