chore: simplify dynamo check
This commit is contained in:
@@ -195,8 +195,7 @@ class HFCausalTrainerBuilder(TrainerBuilderBase):
|
|||||||
if self.cfg.greater_is_better:
|
if self.cfg.greater_is_better:
|
||||||
training_arguments_kwargs["greater_is_better"] = self.cfg.greater_is_better
|
training_arguments_kwargs["greater_is_better"] = self.cfg.greater_is_better
|
||||||
|
|
||||||
if self.cfg.torch_compile:
|
if self.cfg.torch_compile and getattr(torch, "_dynamo", None):
|
||||||
if torch._dynamo: # pylint: disable=protected-access
|
|
||||||
torch._dynamo.config.suppress_errors = ( # pylint: disable=protected-access
|
torch._dynamo.config.suppress_errors = ( # pylint: disable=protected-access
|
||||||
True
|
True
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user