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

KeyError: 'MPLUGOwl2Config' #42

Open
MengHao666 opened this issue Dec 13, 2024 · 4 comments
Open

KeyError: 'MPLUGOwl2Config' #42

MengHao666 opened this issue Dec 13, 2024 · 4 comments

Comments

@MengHao666
Copy link

Following your instruction, I run

export DEFAULT_IMG_PATH=fig/baby.mp4
python q_align/evaluate/scorer.py --img_path $DEFAULT_IMG_PATH --video --model-path q-future/one-align

and I meet such error

Traceback (most recent call last):
  File "/Users/momiao/Desktop/Projects/Q-Align/q_align/evaluate/scorer.py", line 147, in <module>
    scorer = QAlignVideoScorer(pretrained=args.model_path, device=args.device)
  File "/Users/momiao/Desktop/Projects/Q-Align/q_align/evaluate/scorer.py", line 102, in __init__
    tokenizer, model, image_processor, _ = load_pretrained_model(pretrained, None, "mplug_owl2", device=device)
  File "/Users/momiao/Desktop/Projects/Q-Align/q_align/model/builder.py", line 106, in load_pretrained_model
    tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
  File "/Users/momiao/miniforge3/envs/q_align/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 803, in from_pretrained
    tokenizer_class_py, tokenizer_class_fast = TOKENIZER_MAPPING[type(config)]
  File "/Users/momiao/miniforge3/envs/q_align/lib/python3.9/site-packages/transformers/models/auto/auto_factory.py", line 737, in __getitem__
    model_type = self._reverse_config_mapping[key.__name__]
KeyError: 'MPLUGOwl2Config'
@MengHao666
Copy link
Author

could anyone help me about this question? Does this repo really have such good results as they claimed?

@MengHao666
Copy link
Author

following code does not work either

import pyiqa
import torch

qalign = pyiqa.create_metric('qalign').cuda()
quality_score = qalign(input, task_='quality')
aesthetic_score = qalign(input, task_='aesthetic')

@trojblue
Copy link

did you try pip install "transformers==4.36.1"? I ran into the issue similar to this and the solution there fixes it

@MengHao666
Copy link
Author

did you try pip install "transformers==4.36.1"? I ran into the issue similar to this and the solution there fixes it

I tried but failed the same.

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

2 participants