qlora icon indicating copy to clipboard operation
qlora copied to clipboard

Update qlora.py

Open rain-1 opened this issue 1 year ago • 1 comments

add n_gpus = 0 default value to get_accelerate_model

Fixes this error:

Traceback (most recent call last): File "qlora.py", line 841, in train() File "qlora.py", line 704, in train model, tokenizer = get_accelerate_model(args, checkpoint_dir) File "qlora.py", line 297, in get_accelerate_model max_memory = {i: max_memory for i in range(n_gpus)} UnboundLocalError: local variable 'n_gpus' referenced before assignment

rain-1 avatar Jul 24 '23 18:07 rain-1

HI @rain-1, the way QLoRA was set up with Bitsandbytes requires GPUs and doesn't work with CPU only. I don't think we should have a base case of n_gpu=0.

artidoro avatar Jul 26 '23 09:07 artidoro