File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33from enum import Enum
4- from typing import List , Literal
4+ from typing import List , Literal , Any
55
66from pydantic import StrictBool , Field , field_validator
77
@@ -329,9 +329,16 @@ class FinetuneDownloadResult(BaseModel):
329329
330330class FinetuneFullTrainingLimits (BaseModel ):
331331 max_batch_size : int
332- max_batch_size_dpo : int
332+ max_batch_size_dpo : int = - 1
333333 min_batch_size : int
334334
335+ def __init__ (self , ** data : Any ) -> None :
336+ super ().__init__ (** data )
337+ if self .max_batch_size_dpo == - 1 :
338+ half_max = self .max_batch_size // 2
339+ rounded_half_max = (half_max // 8 ) * 8
340+ self .max_batch_size_dpo = max (self .min_batch_size , rounded_half_max )
341+
335342
336343class FinetuneLoraTrainingLimits (FinetuneFullTrainingLimits ):
337344 max_rank : int
You can’t perform that action at this time.
0 commit comments