Error when running the official demo codes

#1
by dtf0709 - opened

If I directly run the demo codes, tokenlizer will have TypeError like this:

Exception has occurred: TypeError
expected str, bytes or os.PathLike object, not NoneType
File "/mnt/training_yrfs/p8n/camera/personal/tengfei.da/aidrive_data_extract_0616/label_aeb_odd_data/Mini-InternVL2-4B-DA-BDD.py", line 93, in
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, use_fast=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

If remove use_fast=False from tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, use_fast=False), then model.chat will have such error:
Traceback (most recent call last):
File "", line 2, in
File "/root/.cache/huggingface/modules/transformers_modules/OpenGVLab/Mini-InternVL2-4B-DA-BDD/dc4724a225f46f6f8dd78db74d01730245b28ee1/modeling_internvl_chat.py", line 291, in chat
generation_output = self.generate(
^^^^^^^^^^^^^^
File "/mnt/training_yrfs/prediction/aidrive/miniconda3/envs/aidrive-torch26-py312/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/huggingface/modules/transformers_modules/OpenGVLab/Mini-InternVL2-4B-DA-BDD/dc4724a225f46f6f8dd78db74d01730245b28ee1/modeling_internvl_chat.py", line 340, in generate
outputs = self.language_model.generate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/training_yrfs/prediction/aidrive/miniconda3/envs/aidrive-torch26-py312/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1928, in getattr
raise AttributeError(
AttributeError: 'Phi3ForCausalLM' object has no attribute 'generate'

But it is OK to run with OpenGVLab/Mini-InternVL2-1B-DA-BDD. What's the cause to the problems?

Sign up or log in to comment