[Question]: altclip直接运行example的inference.py报错KeyError: 'text_config'
susht3 opened this issue · comments
Description
没有任何修改,报错:
Traceback (most recent call last):
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/nvme/nvme0//github/FlagAI/examples/AltCLIP/altclip_inference.py", line 7, in
loader = AutoLoader(
File "/nvme/nvme0//github/FlagAI/flagai/auto_model/auto_loader.py", line 218, in init
self.model = getattr(LazyImport(self.model_name[0]),
File "/nvme/nvme0//github/FlagAI/flagai/model/mm/AltCLIP.py", line 452, in from_pretrain
return CLIPHF.from_pretrained(pretrained_model_name_or_path)
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2530, in from_pretrained
config, model_kwargs = cls.config_class.from_pretrained(
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/site-packages/transformers/configuration_utils.py", line 598, in from_pretrained
return cls.from_dict(config_dict, **kwargs)
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/site-packages/transformers/configuration_utils.py", line 775, in from_dict
logger.info(f"Model config {config}")
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/site-packages/transformers/configuration_utils.py", line 807, in repr
return f"{self.class.name} {self.to_json_string()}"
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/site-packages/transformers/configuration_utils.py", line 910, in to_json_string
config_dict = self.to_diff_dict()
File "/nvme/nvme0//anaconda3/envs/py3/lib/python3.8/site-packages/transformers/configuration_utils.py", line 823, in to_diff_dict
class_config_dict = self.class().to_dict() if not self.is_composition else {}
File "/nvme/nvme0//github/FlagAI/flagai/model/mm/AltCLIP.py", line 84, in init
self.text_config = STUDENT_CONFIG_DICTkwargs['text_config']['model_type']
KeyError: 'text_config'
Alternatives
No response
hi, I met the same bug, have you solved it?
reinstall the older version of flagai, like 1.6.4 which is suitable for me.