Skip to content

Latest version of transformers breaks Infinity Server #590

Description

@vrdn-23

System Info

INFO     2025-05-20 20:03:58,938 datasets INFO: PyTorch version     config.py:54
         2.6.0 available.                                                       
Traceback (most recent call last):
  File "/app/.venv/bin/infinity_emb", line 4, in <module>
    from infinity_emb.cli import cli
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/__init__.py", line 27, in <module>
    from infinity_emb.engine import AsyncEmbeddingEngine, AsyncEngineArray  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/engine.py", line 11, in <module>
    from infinity_emb.inference import (
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/inference/__init__.py", line 4, in <module>
    from infinity_emb.inference.batch_handler import BatchHandler
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/inference/batch_handler.py", line 39, in <module>
    from infinity_emb.transformer.utils import get_lengths_with_tokenize
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/transformer/utils.py", line 9, in <module>
    from infinity_emb.transformer.classifier.torch import SentenceClassifier
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/transformer/classifier/torch.py", line 8, in <module>
    from infinity_emb.transformer.acceleration import (
  File "/app/.venv/lib/python3.12/site-packages/infinity_emb/transformer/acceleration.py", line 11, in <module>
    from optimum.bettertransformer import (  # type: ignore[import-untyped]
  File "/app/.venv/lib/python3.12/site-packages/optimum/bettertransformer/__init__.py", line 20, in <module>
    raise RuntimeError(
RuntimeError: BetterTransformer requires transformers<4.49 but found 4.50.0. `optimum.bettertransformer` is deprecated and will be removed in optimum v2.0.

We might need to pin the transformers version or maybe even deprecate the better transformer version

Information

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

Tasks

  • An officially supported CLI command
  • My own modifications

Reproduction

uv run infinity_emb v2 --model-id any-model --port 8000 --url-prefix /v1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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