Text Generation
Transformers
Safetensors
imp_phi3
conversational
custom_code

ModuleNotFoundError

#1
by edmond - opened

Hello, I use transformers 4.41.2 and when I try to run your HF sample code I have :

Cell In[50], line 8
model = AutoModelForCausalLM.from_pretrained(

File ~\Anaconda3\envs\py39\lib\site-packages\transformers\models\auto\auto_factory.py:550 in from_pretrained
model_class = get_class_from_dynamic_module(

File ~\Anaconda3\envs\py39\lib\site-packages\transformers\dynamic_module_utils.py:513 in get_class_from_dynamic_module
return get_class_in_module(class_name, final_module)

File ~\Anaconda3\envs\py39\lib\site-packages\transformers\dynamic_module_utils.py:211 in get_class_in_module
module_spec.loader.exec_module(module)

File :850 in exec_module

File :228 in _call_with_frames_removed

File ~.cache\huggingface\modules\transformers_modules\MILVLG\Imp-v1.5-4B-Phi3\67394b9e49f912e892814ef922e1c485e91bf9e4\modeling_imp.py:44
from .vision_encoder import VisionTower

ModuleNotFoundError: No module named 'transformers_modules.MILVLG.Imp-v1'

Thanks for your issue.
You can add '/' after "MILVLG/Imp-v1.5-4B-Phi3", then it should be work.
And we will update it.

After I add '/' to the model path, I get this error.

from transformers import pipeline

messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe = pipeline(
    "text-generation",
    model="MILVLG/Imp-v1.5-4B-Phi3/",
    trust_remote_code=True,
    revision="main"
)
pipe(messages)


---------------------------------------------------------------------------

HFValidationError                         Traceback (most recent call last)

[/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py](https://localhost:8080/#) in cached_files(path_or_repo_id, filenames, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
    423             # This is slightly better for only 1 file
--> 424             hf_hub_download(
    425                 path_or_repo_id,

9 frames

HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'MILVLG/Imp-v1.5-4B-Phi3/'. Use `repo_type` argument if needed.


During handling of the above exception, another exception occurred:

HFValidationError                         Traceback (most recent call last)

[/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_validators.py](https://localhost:8080/#) in validate_repo_id(repo_id)
    152 
    153     if repo_id.count("/") > 1:
--> 154         raise HFValidationError(
    155             "Repo id must be in the form 'repo_name' or 'namespace/repo_name':"
    156             f" '{repo_id}'. Use `repo_type` argument if needed."

HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'MILVLG/Imp-v1.5-4B-Phi3/'. Use `repo_type` argument if needed

Sign up or log in to comment