Skip to content

[Bug]: ModuleNotFoundError: No module named 'optimum.bettertransformer' when running v2 CLI #656

@yuliu625

Description

@yuliu625

System Info

Environment:

  • OS: Windows 11
  • Python Version: 3.12 (Anaconda)
  • Library Version: infinity-emb[all] (Latest)
  • Installation Command: pip install infinity-emb[all]

Information

  • Docker + cli
  • pip + cli
  • pip + usage of Python interface

Tasks

  • An officially supported CLI command
  • My own modifications

Reproduction

Description:
I am encountering a ModuleNotFoundError when trying to run the infinity_emb v2 --help command on Windows, even after installing with the [all] extra.

Steps to Reproduce:

  1. Create a new conda/python environment.
  2. Run pip install "infinity-emb[all]".
  3. Run infinity_emb v2 --help.

Error Traceback:

Traceback (most recent call last):
...
  File "...\infinity_emb\transformer\classifier\torch.py", line 8, in <module>
    from infinity_emb.transformer.acceleration import (
  File "...\infinity_emb\transformer\acceleration.py", line 11, in <module>
    from optimum.bettertransformer import (  # type: ignore[import-untyped]
ModuleNotFoundError: No module named 'optimum.bettertransformer'

Additional Context:
It seems that optimum is installed, but optimum.bettertransformer is either not found or not correctly bundled in the Windows installation of the dependency tree. Manually installing optimum does not seem to resolve the specific import error within acceleration.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions