Skip to content

Conversation

rain-1
Copy link

@rain-1 rain-1 commented Jul 24, 2023

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

add n_gpus = 0 default value to get_accelerate_model
@artidoro
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants