Skip to content

ModuleNotFoundError: No module named 'prismatic' #9

@Altriaex

Description

@Altriaex

Hi, I am trying to do model inference with the following code.

  vla = AutoModelForVision2Seq.from_pretrained(
      "declare-lab/Emma-X",
      attn_implementation="flash_attention_2",  # [Optional] Requires `flash_attn`
      torch_dtype=torch.bfloat16, 
      low_cpu_mem_usage=True, 
      trust_remote_code=True
  ).to("cuda:0")
  processor = AutoProcessor.from_pretrained("declare-lab/Emma-X", trust_remote_code=True)

But I encountered the following issue:

guoxi@guoxi-desktop:~/Projects/ecot/emma-x$ uv run python model_server.py 
/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:942: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
config.json: 4.30kB [00:00, 8.14MB/s]
configuration_prismatic.py: 5.87kB [00:00, 2.85MB/s]
A new version of the following files was downloaded from https://huggingface.co/declare-lab/Emma-X:
- configuration_prismatic.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
modeling_prismatic.py: 28.4kB [00:00, 3.12MB/s]
/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:942: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
solver.py: 7.85kB [00:00, 15.6MB/s]
Traceback (most recent call last):
  File "/home/guoxi/Projects/ecot/emma-x/model_server.py", line 39, in <module>
    main()
  File "/home/guoxi/Projects/ecot/emma-x/model_server.py", line 12, in main
    vla = AutoModelForVision2Seq.from_pretrained(
  File "/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 550, in from_pretrained
    model_class = get_class_from_dynamic_module(
  File "/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 489, in get_class_from_dynamic_module
    final_module = get_cached_module_file(
  File "/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 353, in get_cached_module_file
    get_cached_module_file(
  File "/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 315, in get_cached_module_file
    modules_needed = check_imports(resolved_module_file)
  File "/home/guoxi/Projects/ecot/emma-x/.venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 180, in check_imports
    raise ImportError(
ImportError: This modeling file requires the following packages that were not found in your environment: prismatic. Run `pip install prismatic`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions