Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update qlora.py #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update qlora.py #231

wants to merge 1 commit into from

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