[Misc][LoRA] Increase max vocab size limit to 258048 in logits processor (#34773)

Signed-off-by: Bhoomit Vasani <vbhoomit@amazon.com>
This commit is contained in:
Bhoomit
2026-02-25 23:30:55 +08:00
committed by GitHub
parent af5e6afa0a
commit 42489e43c2
3 changed files with 34 additions and 9 deletions
+2 -2
View File
@@ -88,9 +88,9 @@ class LogitsProcessorWithLoRA(BaseLayerWithLoRA):
model_config: PretrainedConfig | None = None,
) -> None:
# TODO: Verify if this condition can be further relaxed
if 32000 < self.base_layer.vocab_size > 257024:
if self.base_layer.vocab_size <= 32000 or self.base_layer.vocab_size > 258048:
raise ValueError(
"When using LoRA, vocab size must be 32000 >= vocab_size <= 257024"
"When using LoRA, vocab size must be > 32000 and <= 258048"
)
self.lora_a_stacked = torch.zeros(
(