mirror of
https://github.com/storytold/FineTrainers-Conditioning.git
synced 2026-10-17 00:23:35 +00:00
[optimization] support 8bit optims from bistandbytes (#163)
* support 8bit optims from bnb. * fix exist_ok * use_8bit_bnb. * fix. * note in readme.
This commit is contained in:
@@ -39,6 +39,7 @@ def get_optimizer(
|
||||
weight_decay=weight_decay,
|
||||
)
|
||||
|
||||
# TODO: consider moving the validation logic to `args.py` when we have torchao.
|
||||
if use_8bit and use_4bit:
|
||||
raise ValueError("Cannot set both `use_8bit` and `use_4bit` to True.")
|
||||
|
||||
@@ -46,7 +47,6 @@ def get_optimizer(
|
||||
try:
|
||||
import torchao
|
||||
|
||||
torchao.__version__
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"To use optimizers from torchao, please install the torchao library: `USE_CPP=0 pip install torchao`."
|
||||
|
||||
Reference in New Issue
Block a user