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

AttributeError: object has no attribute 'devices' #125

Open
QiueY514 opened this issue Oct 9, 2023 · 0 comments
Open

AttributeError: object has no attribute 'devices' #125

QiueY514 opened this issue Oct 9, 2023 · 0 comments

Comments

@QiueY514
Copy link

QiueY514 commented Oct 9, 2023

Hi, I try to set Blip2OPT to multiple GPUs as follows, but there is an error:

model, vis_processors, _ = load_model_and_preprocess(name="blip2_opt", model_type="pretrain_opt2.7b", is_eval=True, device='cpu')
model = TensorParallelPreTrainedModel(model, ["cuda:0", "cuda:1", "cuda:2"])

Traceback (most recent call last):
File "", line 1, in
File "/data/SSD1/My/anaconda3/envs/ov/lib/python3.8/site-packages/tensor_parallel/pretrained_model.py", line 47, in init
super().init(module.config) # Temporary empty config. Gets replaced in from_pretrained
File "/data/SSD1/My/anaconda3/envs/ov/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Blip2OPT' object has no attribute 'config'

So how can I use tnsor_parallel for a model that not belongs to meta model? Thanks!

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

No branches or pull requests

1 participant