X-PLUG / mPLUG-Owl

mPLUG-Owl: The Powerful Multi-modal Large Language Model Family
https://www.modelscope.cn/studios/damo/mPLUG-Owl
MIT License
2.33k stars 176 forks source link

how to run #245

Open AntyRia opened 2 months ago

AntyRia commented 2 months ago

ModuleNotFoundError: No module named 'configuration_mplugowl3'

ecoli-hit commented 2 months ago

Can simply use transformers to load config and model, the package is downloaded within the model.

LukeForeverYoung commented 1 month ago

Does this code span work for you?

import torch
from transformers import AutoConfig, AutoModel
model_path = 'mPLUG/mPLUG-Owl3-7B-240728'
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
print(config)
# model = mPLUGOwl3Model(config).cuda().half()
model = AutoModel.from_pretrained(model_path, attn_implementation='sdpa', torch_dtype=torch.half, trust_remote_code=True)
model.eval().cuda()