Fix temperature_last when temperature not in sampler priority (#6439)

This commit is contained in:
PIRI 2024-10-09 14:25:14 +00:00 committed by GitHub
parent 9d8b1c5fd9
commit 03a2e70054
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -571,11 +571,10 @@ def get_logits_processor_patch(self, **kwargs):
if generation_config.temperature_last: if generation_config.temperature_last:
for param_name in ['temperature', 'dynamic_temperature', 'quadratic_sampling']: for param_name in ['temperature', 'dynamic_temperature', 'quadratic_sampling']:
if param_name in sampler_priority: if param_name in sampler_priority:
if param_name in sampler_priority: index = sampler_priority.index(param_name)
index = sampler_priority.index(param_name) sampler_priority.append(sampler_priority.pop(index))
sampler_priority.append(sampler_priority.pop(index)) else:
else: sampler_priority.append(param_name)
sampler_priority.append(param_name)
class_name_to_nickname = { class_name_to_nickname = {
'DynamicTemperatureLogitsWarper': 'dynamic_temperature', 'DynamicTemperatureLogitsWarper': 'dynamic_temperature',