model = AutoModelForCausalLM.from_pretrained("q-future/co-instruct",
trust_remote_code=True,
torch_dtype=torch.float16,
attn_implementation="eager",
device_map={"":"cuda:0"})
Traceback (most recent call last):
File "./test_co-ins.py", line 17, in
device_map={"":"cuda:0"})
File "$MY_PATH$/python3.7/site-packages/transformers/models/auto/auto_factory.py", line 476, in from_pretrained
class_ref, pretrained_model_name_or_path, **hub_kwargs, **kwargs
File "$MY_PATH$/python3.7/site-packages/transformers/dynamic_module_utils.py", line 443, in get_class_from_dynamic_module
return get_class_in_module(class_name, final_module.replace(".py", ""))
File "$MY_PATH$/python3.7/site-packages/transformers/dynamic_module_utils.py", line 164, in get_class_in_module
module = importlib.import_module(module_path)
File "$MY_PATH$/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "$MY_PATH$/.cache/huggingface/modules/transformers_modules/q-future/co-instruct/bc0349eee484e340fb1c1786f4d800bb183d3d43/modeling_mplug_owl2.py", line 35, in
from .modeling_llama2 import replace_llama_modality_adaptive
File "$MY_PATH$/.cache/huggingface/modules/transformers_modules/q-future/co-instruct/bc0349eee484e340fb1c1786f4d800bb183d3d43/modeling_llama2.py", line 212, in
class LlamaFlashAttention2(LlamaAttention):
File "$MY_PATH$/.cache/huggingface/modules/transformers_modules/q-future/co-instruct/bc0349eee484e340fb1c1786f4d800bb183d3d43/modeling_llama2.py", line 235, in LlamaFlashAttention2
use_cache: bool = False,
NameError: name 'Cache' is not defined
Does it mean that my versions of packages are not appropriate? If so, would you please provide the requirements of the model?