[Bug]: ModuleNotFoundError: No module named 'optimum.bettertransformer' when running v2 CLI
### 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
- [x] pip + cli
- [ ] pip + usage of Python interface
### Tasks
- [x] 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:**
```text
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`.
4 条评论