add smoothing curve, not tested

This commit is contained in:
LostRuins Concedo
2025-11-17 23:07:35 +08:00
parent 3fe0e39b62
commit 281542aa0d
5 changed files with 203 additions and 70 deletions
+3
View File
@@ -260,6 +260,7 @@ class generation_inputs(ctypes.Structure):
("dynatemp_range", ctypes.c_float),
("dynatemp_exponent", ctypes.c_float),
("smoothing_factor", ctypes.c_float),
("smoothing_curve", ctypes.c_float),
("dry_multiplier", ctypes.c_float),
("dry_base", ctypes.c_float),
("dry_allowed_length", ctypes.c_int),
@@ -1557,6 +1558,7 @@ def generate(genparams, stream_flag=False):
dynatemp_range = tryparsefloat(genparams.get('dynatemp_range', 0.0),0.0)
dynatemp_exponent = tryparsefloat(genparams.get('dynatemp_exponent', 1.0),1.0)
smoothing_factor = tryparsefloat(genparams.get('smoothing_factor', 0.0),0.0)
smoothing_curve = tryparsefloat(genparams.get('smoothing_curve', 1.0),1.0)
logit_biases = genparams.get('logit_bias', {})
render_special = genparams.get('render_special', False)
banned_strings = genparams.get('banned_strings', []) # SillyTavern uses that name
@@ -1619,6 +1621,7 @@ def generate(genparams, stream_flag=False):
inputs.dynatemp_range = dynatemp_range
inputs.dynatemp_exponent = dynatemp_exponent
inputs.smoothing_factor = smoothing_factor
inputs.smoothing_curve = smoothing_curve
inputs.grammar = grammar.encode("UTF-8")
inputs.grammar_retain_state = grammar_retain_state
inputs.allow_eos_token = not ban_eos_token