From 03a2e7005412efb7765ce3f0bfccd6b94e79a843 Mon Sep 17 00:00:00 2001 From: PIRI <34787507+ThisIsPIRI@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:25:14 +0000 Subject: [PATCH] Fix temperature_last when temperature not in sampler priority (#6439) --- modules/sampler_hijack.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/sampler_hijack.py b/modules/sampler_hijack.py index 87f0b25e..97951dd2 100644 --- a/modules/sampler_hijack.py +++ b/modules/sampler_hijack.py @@ -571,11 +571,10 @@ def get_logits_processor_patch(self, **kwargs): if generation_config.temperature_last: for param_name in ['temperature', 'dynamic_temperature', 'quadratic_sampling']: if param_name in sampler_priority: - if param_name in sampler_priority: - index = sampler_priority.index(param_name) - sampler_priority.append(sampler_priority.pop(index)) - else: - sampler_priority.append(param_name) + index = sampler_priority.index(param_name) + sampler_priority.append(sampler_priority.pop(index)) + else: + sampler_priority.append(param_name) class_name_to_nickname = { 'DynamicTemperatureLogitsWarper': 'dynamic_temperature',