Skip to content

fix: don't cache partial model downloads as valid files - #46

Closed
btfcookies wants to merge 1 commit into
MrDragon0011:mainfrom
btfcookies:fix/partial-model-download
Closed

fix: don't cache partial model downloads as valid files#46
btfcookies wants to merge 1 commit into
MrDragon0011:mainfrom
btfcookies:fix/partial-model-download

Conversation

@btfcookies

Copy link
Copy Markdown

Both the pose-landmarker download and the FSRCNN upscaler download wrote straight to the final path with urlretrieve. An interrupted download left a truncated file that the exists()/is_file() fast-path then accepted as a valid model on every subsequent run — the server never re-downloaded and model loading failed permanently. Download to a .tmp file and atomically rename into place only on success; clean up the temp file on failure.

Both the pose-landmarker download and the FSRCNN upscaler download wrote
straight to the final path with urlretrieve. An interrupted download left
a truncated file that the exists()/is_file() fast-path then accepted as a
valid model on every subsequent run — the server never re-downloaded and
model loading failed permanently. Download to a .tmp file and atomically
rename into place only on success; clean up the temp file on failure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copy link
Copy Markdown
Owner

Merged manually (squash) — thanks for the fix! Your original commit is preserved above.


Generated by Claude Code

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