Skip to content

Commit

Permalink
Fix temperature_last when temperature not in sampler priority (#6439)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsPIRI authored Oct 9, 2024
1 parent 9d8b1c5 commit 03a2e70
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/sampler_hijack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 03a2e70

Please sign in to comment.