mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Revert "API: Rename repetition_decay -> repetition_slope"
This reverts commit cad144126f.
Change this parameter back to repetition_decay. This is different than
rep_pen_slope used in other backends such as kobold and NAI.
Still keep the fallback condition though.
Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
7
model.py
7
model.py
@@ -250,7 +250,7 @@ class ModelContainer:
|
||||
'mirostat_eta' (float) Mirostat eta parameter (default: 0.1)
|
||||
'repetition_penalty' (float): Token repetition/presence penalty (default: 1.15)
|
||||
'repetition_range' (int): Repetition penalty range (default: whole context)
|
||||
'repetition_slope' (int): Repetition penalty range (default: same as range)
|
||||
'repetition_decay' (int): Repetition penalty range (default: same as range)
|
||||
'stop' (List[Union[str, int]]): List of stop strings/tokens to end response (default: [EOS])
|
||||
'max_tokens' (int): Max no. tokens in response (default: 150)
|
||||
'add_bos_token' (bool): Adds the BOS token to the start of the prompt (default: True)
|
||||
@@ -302,10 +302,11 @@ class ModelContainer:
|
||||
gen_settings.token_repetition_penalty = kwargs.get("repetition_penalty", 1.0)
|
||||
gen_settings.token_repetition_range = kwargs.get("repetition_range", self.config.max_seq_len)
|
||||
|
||||
|
||||
# Always make sure the fallback is 0 if range < 0
|
||||
# It's technically fine to use -1, but this just validates the passed fallback
|
||||
fallback_slope = 0 if gen_settings.token_repetition_penalty <= 0 else gen_settings.token_repetition_range
|
||||
gen_settings.token_repetition_decay = kwargs.get("repetition_slope", fallback_slope or 0)
|
||||
fallback_decay = 0 if gen_settings.token_repetition_penalty <= 0 else gen_settings.token_repetition_range
|
||||
gen_settings.token_repetition_decay = kwargs.get("repetition_decay", fallback_decay or 0)
|
||||
|
||||
stop_conditions: List[Union[str, int]] = kwargs.get("stop", [])
|
||||
ban_eos_token = kwargs.get("ban_eos_token", False)
|
||||
|
||||
Reference in New Issue
Block a user