feat: add safe distributed checkpoint intake and preflight

This commit is contained in:
Joseph Magly
2026-09-04 19:43:53 -04:00
parent 5cc43c6e52
commit 985c9e9363
108 changed files with 21726 additions and 92 deletions
+14
View File
@@ -215,6 +215,20 @@ def test_load_json_local_missing_returns_none(tmp_path):
assert qd._load_json_from_checkpoint(str(tmp_path), "missing.json") is None
def test_load_json_remote_unexpected_download_failure_returns_none(monkeypatch):
def fail_download(*args, **kwargs):
raise OSError("offline")
monkeypatch.setattr("huggingface_hub.hf_hub_download", fail_download)
assert qd._load_json_from_checkpoint(
"org/model",
"config.json",
revision="immutable-sha",
local_files_only=True,
) is None
def test_safetensors_key_names_reads_single_file_and_index(tmp_path):
from safetensors.torch import save_file