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:
Wing Lian
2025-07-17 15:32:38 -04:00
committed by GitHub
parent a798975b7c
commit 5f5ae76213

View File

@@ -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