[Deprecation] Deprecate functions as scheduled for v0.21.0 (#43358)
Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
aa6138169f
commit
c02c758ea4
@@ -92,18 +92,6 @@ class PoolerConfig:
|
||||
activation((logit - logit_mean) / logit_sigma). Defaults to None.
|
||||
"""
|
||||
|
||||
# Deprecated aliases — will be removed in v0.21
|
||||
logit_bias: float | None = None
|
||||
"""
|
||||
Deprecated: Use logit_mean instead. Will be removed in v0.21.
|
||||
"""
|
||||
|
||||
logit_scale: float | None = None
|
||||
"""
|
||||
Deprecated: Use logit_sigma instead (note: logit_sigma = 1/logit_scale).
|
||||
Will be removed in v0.21.
|
||||
"""
|
||||
|
||||
## for reward models
|
||||
step_tag_id: int | None = None
|
||||
"""
|
||||
@@ -119,36 +107,6 @@ class PoolerConfig:
|
||||
"""
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
# Handle deprecated logit_bias → logit_mean
|
||||
if self.logit_bias is not None:
|
||||
if self.logit_mean is not None:
|
||||
raise ValueError(
|
||||
"Cannot set both `logit_bias` and `logit_mean`. "
|
||||
"`logit_bias` is deprecated, use `logit_mean` instead."
|
||||
)
|
||||
logger.warning(
|
||||
"`logit_bias` is deprecated and will be removed in v0.21. "
|
||||
"Use `logit_mean` instead."
|
||||
)
|
||||
self.logit_mean = self.logit_bias
|
||||
self.logit_bias = None
|
||||
|
||||
# Handle deprecated logit_scale → logit_sigma
|
||||
if self.logit_scale is not None:
|
||||
if self.logit_sigma is not None:
|
||||
raise ValueError(
|
||||
"Cannot set both `logit_scale` and `logit_sigma`. "
|
||||
"`logit_scale` is deprecated, use `logit_sigma` instead."
|
||||
)
|
||||
logger.warning(
|
||||
"`logit_scale` is deprecated and will be removed in v0.21. "
|
||||
"Use `logit_sigma` instead (logit_sigma = 1/logit_scale)."
|
||||
)
|
||||
if self.logit_scale == 0:
|
||||
raise ValueError("logit_scale cannot be 0 (division by zero)")
|
||||
self.logit_sigma = 1.0 / self.logit_scale
|
||||
self.logit_scale = None
|
||||
|
||||
if self.logit_sigma is not None and self.logit_sigma == 0:
|
||||
raise ValueError("logit_sigma cannot be 0 (division by zero)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user