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

feat: Allow multiple ML models to be preloaded #15418

Merged
merged 46 commits into from
Jan 21, 2025
Merged

Conversation

1-tempest
Copy link
Contributor

Add support for a comma separated values in ML preload environment variables

@1-tempest 1-tempest requested a review from mertalev as a code owner January 18, 2025 02:58
@github-actions github-actions bot added documentation Improvements or additions to documentation 🧠machine-learning labels Jan 18, 2025
@@ -77,29 +77,31 @@ async def lifespan(_: FastAPI) -> AsyncGenerator[None, None]:
async def preload_models(preload: PreloadModelData) -> None:
log.info(f"Preloading models: clip:{preload.clip} facial_recognition:{preload.facial_recognition}")

async def load_models(model_string: str, model_type: "ModelType", model_task: "ModelTask") -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the quoted types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I thought they were required.
Quotes have been removed, however I have not tested this latest version yet as I've made changes on mobile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found time to run it locally. It seems to load models as desired

machine-learning/app/main.py Outdated Show resolved Hide resolved
@mertalev mertalev merged commit 1d0d4fc into immich-app:main Jan 21, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:feature documentation Improvements or additions to documentation 🧠machine-learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants