rm useless condition since the previous condition contains it. (#25403)

This commit is contained in:
jiqing-feng 2023-08-09 15:31:24 +08:00 committed by GitHub
parent 1564a81ac5
commit 85447bb22e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1086,14 +1086,6 @@ class Trainer:
optimizer_kwargs.update(bnb_kwargs)
except ImportError:
raise ValueError("Trainer tried to instantiate bnb optimizer but bnb is not installed!")
elif args.optim == OptimizerNames.ADAMW_BNB:
try:
from bitsandbytes.optim import Adam8bit
optimizer_cls = Adam8bit
optimizer_kwargs.update(adam_kwargs)
except ImportError:
raise ValueError("Trainer tried to instantiate bnb Adam8bit but bnb is not installed!")
elif args.optim == OptimizerNames.ADAMW_ANYPRECISION:
try:
from torchdistx.optimizers import AnyPrecisionAdamW