michaelfeil / michaelfeil/infinity
[Bug]: ModuleNotFoundError: No module named 'optimum.bettertransformer' when running v2 CLI
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
### 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
from infinity_emb.transformer.acceleration import (
File "...\infinity_emb\transformer\acceleration.py", line 11, in
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`.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with infinity_emb/transformer/acceleration.py and the import reached through infinity_emb/transformer/classifier/torch.py when running `infinity_emb v2 --help`. Reproduce the clean Windows installation with `pip install "infinity-emb[all]"`, then verify that the CLI help command starts without the reported ModuleNotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100