From 1aa2b924d2b2fa43f1c7a46f28599c8025e779e1 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 9 Oct 2025 10:52:31 -0700 Subject: [PATCH] Downloader: Gracefully handle '416 Range Not Satisfiable' when continuing downloads --- download-model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/download-model.py b/download-model.py index c0a3aa36..f9bca97b 100644 --- a/download-model.py +++ b/download-model.py @@ -255,6 +255,11 @@ class ModelDownloader: mode = 'ab' with session.get(url, stream=True, headers=headers, timeout=30) as r: + # Assume error 416 (range unsatisfiable) means the download is complete. + # Small size differences can happen in Git LFS + if mode == 'ab' and r.status_code == 416: + break + r.raise_for_status() total_size_from_stream = int(r.headers.get('content-length', 0)) if mode == 'ab':