add validation around cce + chunked_ce (#2932) [skip ci]
* add validation around cce + chunked_ce * return on end of validation method
This commit is contained in:
@@ -41,3 +41,13 @@ class CutCrossEntropyArgs(BaseModel):
|
||||
)
|
||||
|
||||
return data
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def check_chunked_cross_entropy_not_set(cls, data):
|
||||
if data.get("chunked_cross_entropy"):
|
||||
raise ValueError(
|
||||
"Cut Cross Entropy does not support chunked cross entropy. "
|
||||
"Please set `chunked_cross_entropy` to `False` or disable Cut Cross Entropy."
|
||||
)
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user