From bd2c5d0d097fbccca95f5b10567ba72e18747591 Mon Sep 17 00:00:00 2001 From: DocShotgun <126566557+DocShotgun@users.noreply.github.com> Date: Sat, 2 Dec 2023 21:19:59 -0800 Subject: [PATCH] Force auto-alpha to 1.0 if config ctx == base ctx --- model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model.py b/model.py index b0cf3b8..564965b 100644 --- a/model.py +++ b/model.py @@ -79,6 +79,7 @@ class ModelContainer: else: ratio = self.config.max_seq_len / base_seq_len alpha = -0.13436 + 0.80541 * ratio + 0.28833 * ratio ** 2 + if ratio == 1: alpha = 1.0 self.config.scale_alpha_value = alpha if "no_flash_attn" in kwargs: self.config.no_flash_attn = kwargs["no_flash_attn"] @@ -113,6 +114,7 @@ class ModelContainer: else: ratio = self.config.max_seq_len / self.draft_config.max_seq_len alpha = -0.13436 + 0.80541 * ratio + 0.28833 * ratio ** 2 + if ratio == 1: alpha = 1.0 self.draft_config.scale_alpha_value = alpha self.draft_config.max_seq_len = self.config.max_seq_len