mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-24 22:34:41 +01:00
fix: mutable default argument in LogitsBiasProcessor (#7426)
This commit is contained in:
parent
0f5053c0fb
commit
f0014ab01c
|
|
@ -44,8 +44,8 @@ class Stream(transformers.StoppingCriteria):
|
|||
|
||||
|
||||
class LogitsBiasProcessor(LogitsProcessor):
|
||||
def __init__(self, logit_bias={}):
|
||||
self.logit_bias = logit_bias
|
||||
def __init__(self, logit_bias=None):
|
||||
self.logit_bias = logit_bias if logit_bias is not None else {}
|
||||
if self.logit_bias:
|
||||
self.keys = list([int(key) for key in self.logit_bias.keys()])
|
||||
values = [self.logit_bias[str(key)] for key in self.keys]
|
||||
|
|
|
|||
Loading…
Reference in a new issue