Skip to content

AttributeError: object has no attribute 'devices' #125

@QiueY514

Description

@QiueY514

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions