fix model DL doe 4-th time

This commit is contained in:
Dobromir Popov
2026-07-06 22:38:57 +03:00
parent 4f007aeef9
commit 7e7682be47
4 changed files with 106 additions and 14 deletions

View File

@@ -3879,10 +3879,17 @@ class _TrackerHandler(http.server.BaseHTTPRequestHandler):
self.send_header("Content-Type", "application/x-tar")
self.send_header("X-Meshnet-Model-Source", "tracker")
self.end_headers()
# dereference: HF cache snapshots are symlinks into blobs/ — ship contents.
with tarfile.open(fileobj=self.wfile, mode="w|", dereference=True) as archive:
for rel in rel_files:
archive.add(snapshot_dir / rel, arcname=rel)
try:
# dereference: HF cache snapshots are symlinks into blobs/ — ship contents.
with tarfile.open(fileobj=self.wfile, mode="w|", dereference=True) as archive:
for rel in rel_files:
archive.add(snapshot_dir / rel, arcname=rel)
except (BrokenPipeError, ConnectionResetError):
print(
f"model-file download aborted by client "
f"({self.client_address[0]}, model={resolved_name})",
flush=True,
)
def _handle_network_assign(self, parsed: urllib.parse.ParseResult):
"""Assign a new node to fill the biggest uncovered shard gap across HF-model nodes.