Apply logit softcapping in Transformers modelling backend (#52173)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -59,9 +59,10 @@ class CausalMixin(VllmModelForTextGeneration):
|
|||||||
self.lm_head = self.lm_head.tie_weights(module)
|
self.lm_head = self.lm_head.tie_weights(module)
|
||||||
break
|
break
|
||||||
|
|
||||||
logit_scale = getattr(self.text_config, "logit_scale", 1.0)
|
|
||||||
self.logits_processor = LogitsProcessor(
|
self.logits_processor = LogitsProcessor(
|
||||||
self.text_config.vocab_size, scale=logit_scale
|
self.text_config.vocab_size,
|
||||||
|
scale=getattr(self.text_config, "logit_scale", 1.0),
|
||||||
|
soft_cap=getattr(self.text_config, "final_logit_softcapping", None),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.lm_head = PPMissingLayer()
|
self.lm_head = PPMissingLayer()
|
||||||
|
|||||||
Reference in New Issue
Block a user