Skip to content

Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.

ds41 common: range_get retries an IncompleteRead (http.client.HTTPException) like the other connection errors

YanissAmz1e4cde30ae9d
diff --git a/tools/ds41/common.py b/tools/ds41/common.py
index c56030e..91feb3f 100644
--- a/tools/ds41/common.py
+++ b/tools/ds41/common.py
@@ -1,5 +1,6 @@
"""Shared helpers for the DeepSeek-V4.1-Flash streaming converter: HTTP range reads, dtype tables."""
+import http.client
import json
import os
import struct
@@ -76,7 +77,7 @@ def range_get(url: str, start: int, end: int, retries: int = 8, timeout: float =
if len(data) != want:
raise IOError(f"short read: got {len(data)} of {want} bytes")
return (data, total) if with_total else data
- except (urllib.error.URLError, IOError, TimeoutError, ConnectionError) as e:
+ except (urllib.error.URLError, IOError, TimeoutError, ConnectionError, http.client.HTTPException) as e: # IncompleteRead
if isinstance(e, urllib.error.HTTPError) and e.code in (401, 403, 404):
raise
last = e