mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 15:48:04 +01:00
Small fix to make transformers 4.42 functional
This commit is contained in:
parent
66090758df
commit
9dbcb1aeea
@ -359,14 +359,14 @@ class RepetitionPenaltyLogitsProcessorWithRange(LogitsProcessor):
|
|||||||
return scores
|
return scores
|
||||||
|
|
||||||
|
|
||||||
def get_logits_warper_patch(self, generation_config):
|
def get_logits_warper_patch(self, generation_config, **kwargs):
|
||||||
|
|
||||||
# Parameter sanitization
|
# Parameter sanitization
|
||||||
if isinstance(generation_config.temperature, int):
|
if isinstance(generation_config.temperature, int):
|
||||||
generation_config.temperature = float(generation_config.temperature) # Must be float
|
generation_config.temperature = float(generation_config.temperature) # Must be float
|
||||||
|
|
||||||
# Get the original warpers
|
# Get the original warpers
|
||||||
warpers = self._get_logits_warper_old(generation_config)
|
warpers = self._get_logits_warper_old(generation_config, **kwargs)
|
||||||
|
|
||||||
# Replace temperature with our modified class.
|
# Replace temperature with our modified class.
|
||||||
# Currently, it behaves identically to the original.
|
# Currently, it behaves identically to the original.
|
||||||
|
Loading…
Reference in New Issue
Block a user