[PR #3988] [MERGED] fix(ml): model downloading improvements #10194

Closed
opened 2026-02-05 14:17:33 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/3988
Author: @mertalev
Created: 9/6/2023
Status: Merged
Merged: 9/6/2023
Merged by: @alextran1502

Base: mainHead: fix/ml-nosuchfile


📝 Commits (2)

  • afda6e0 handle ort NoSuchFile error, stricter file check
  • 2eb1b39 keep exception order

📊 Changes

2 files changed (+6 additions, -2 deletions)

View changed files

📝 machine-learning/app/models/base.py (+2 -2)
📝 machine-learning/app/models/clip.py (+4 -0)

📄 Description

Description

ONNX Runtime can throw a custom NoSuchFile exception that isn't caught like other IO exceptions, resulting in the model cache not being cleared when it should be.

Additionally, the check for whether CLIP models are downloaded only checks that the folder exists and isn't empty, so it doesn't catch cases where there's a missing file. This isn't as critical since it clears the cache and redownloads on error, but it's better if the missing file can be downloaded without deleting other files.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/3988 **Author:** [@mertalev](https://github.com/mertalev) **Created:** 9/6/2023 **Status:** ✅ Merged **Merged:** 9/6/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `fix/ml-nosuchfile` --- ### 📝 Commits (2) - [`afda6e0`](https://github.com/immich-app/immich/commit/afda6e0abd5de397896bbf3c48fca1c2d0816d64) handle ort `NoSuchFile` error, stricter file check - [`2eb1b39`](https://github.com/immich-app/immich/commit/2eb1b398465addb77cd4ffb8ba6759c99e991705) keep exception order ### 📊 Changes **2 files changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `machine-learning/app/models/base.py` (+2 -2) 📝 `machine-learning/app/models/clip.py` (+4 -0) </details> ### 📄 Description ## Description ONNX Runtime can throw a custom `NoSuchFile` exception that isn't caught like other IO exceptions, resulting in the model cache not being cleared when it should be. Additionally, the check for whether CLIP models are downloaded only checks that the folder exists and isn't empty, so it doesn't catch cases where there's a missing file. This isn't as critical since it clears the cache and redownloads on error, but it's better if the missing file can be downloaded without deleting other files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 14:17:33 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#10194