Skip to content

Support for MacOS #71

@abdalimran

Description

@abdalimran

I was trying to use Reranker in my macos machine. I tried to install the package using uv add "rerankers[monovlm]" but got the below error.
I looks like the package has a dependency on flash-attn which is not supported in macos.

Resolved 156 packages in 527ms
  × Failed to build `flash-attn==2.8.3`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File "/Users/imran/.cache/uv/builds-v0/.tmpZ97s55/lib/python3.12/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/imran/.cache/uv/builds-v0/.tmpZ97s55/lib/python3.12/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "/Users/imran/.cache/uv/builds-v0/.tmpZ97s55/lib/python3.12/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/Users/imran/.cache/uv/builds-v0/.tmpZ97s55/lib/python3.12/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 22, in <module>
      ModuleNotFoundError: No module named 'torch'

      hint: This error likely indicates that `[email protected]` depends on `torch`, but doesn't declare it as a build dependency. If `flash-attn` is a
      first-party package, consider adding `torch` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under:

      [tool.uv.extra-build-dependencies]
      flash-attn = ["torch"]

      or `uv pip install torch` into the environment and re-run with `--no-build-isolation`.
  help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking and syncing.

I've tried force install the package ignoring the flash-attn dependency. But then when I ran the below code, I realized that macos's gpu mps is also not supported.

from rerankers import Reranker

ranker = Reranker("monovlm", device="mps")

Do you have any plan to make this package work on MacOS?

Thanks!

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