Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bumblebee detection #160

Merged
merged 1 commit into from
Aug 31, 2024
Merged

Fix bumblebee detection #160

merged 1 commit into from
Aug 31, 2024

Conversation

mat-hek
Copy link
Contributor

@mat-hek mat-hek commented Aug 26, 2024

Currently, the Image.Classification module is loaded when Bumblebee, Nx and Exla are available. However, Image.Application calls Image.Classification when Bumblebee is available. So, if one has Bumblebee in deps, but not Exla, this error is raised:

** (Mix) Could not start application image: exited in: Image.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function Image.Classification.classifier/0 is undefined (module Image.Classification is not available)
            Image.Classification.classifier()
            (image 0.54.1) lib/application.ex:34: anonymous fn/2 in Image.Application.children/1
            (elixir 1.17.2) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
            (image 0.54.1) lib/application.ex:18: Image.Application.start/2
            (kernel 10.0) application_master.erl:295: :application_master.start_it_old/4

Even though using Bumblebee without Exla may make little sense, this PR aims to fix that by calling Image.bumblebee_configured? in both Application and Classification ;)

@kipcole9 kipcole9 merged commit 52fe559 into elixir-image:main Aug 31, 2024
@kipcole9
Copy link
Collaborator

@mat-hek, thank much and greatfully accepted.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants