Decode target GGUF quant types with pinned ggml for streamed KAR preparation
This commit is contained in:
@@ -133,12 +133,13 @@ def main() -> None:
|
||||
streamed_provenance = json.loads(
|
||||
(root / "streamed.kar.provenance.json").read_text()
|
||||
)
|
||||
assert streamed_provenance["schema"] == "strata-next/sharded-stream-provenance-v1"
|
||||
assert streamed_provenance["schema"] == "strata-next/sharded-stream-provenance-v2"
|
||||
assert streamed_provenance["derivation"] == "strata-next/gguf-shards-to-f32-le-v2:ggml-3cf03257"
|
||||
assert streamed_provenance["levels"] == 2
|
||||
assert streamed_provenance["derived_f32_sha256"] == expected_source
|
||||
assert streamed_provenance["archive_sha256"] == hashlib.sha256(streamed.read_bytes()).hexdigest()
|
||||
assert streamed_provenance["archive_sha256"] == (
|
||||
"51688d265860172feca39e296f9142b1ed16800496bae4b06b4b8d8fa11d806e"
|
||||
"b11aa85b07359631d04c25941b87f7a93ffbd6dcc02462a031129ad168ac1e99"
|
||||
)
|
||||
verify_streamed = subprocess.run(
|
||||
[binary, "model", "verify-sharded-streamed", streamed,
|
||||
@@ -163,6 +164,33 @@ def main() -> None:
|
||||
)
|
||||
assert wrong_level.returncode != 0
|
||||
assert ensured.read_bytes() == streamed.read_bytes()
|
||||
|
||||
iq4_name = "b-iq4.gguf"
|
||||
iq4 = shard("iq4", 20, 32, bytes(18))
|
||||
(root / iq4_name).write_bytes(iq4)
|
||||
quantized_manifest = root / "quantized-shards.json"
|
||||
quantized_manifest.write_text(json.dumps({
|
||||
"schema_version": 1,
|
||||
"files": [
|
||||
{"name": name, "url": f"https://example.invalid/{name}",
|
||||
"size": len(data), "sha256": hashlib.sha256(data).hexdigest()}
|
||||
for name, data in [(iq4_name, iq4), ("z-expert.gguf", shards["z-expert.gguf"])]
|
||||
],
|
||||
}))
|
||||
quantized_archive = root / "quantized.kar"
|
||||
subprocess.run(
|
||||
[binary, "model", "prepare-sharded-streamed", quantized_manifest,
|
||||
"--source-dir", root, "--output", quantized_archive, "--levels", "2"],
|
||||
capture_output=True, text=True, check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
[binary, "model", "verify-sharded-streamed", quantized_archive,
|
||||
"--manifest", quantized_manifest, "--source-dir", root, "--levels", "2"],
|
||||
capture_output=True, text=True, check=True,
|
||||
)
|
||||
assert hashlib.sha256(quantized_archive.read_bytes()).hexdigest() == (
|
||||
"07751adc1f7115258b95613203c935f05cbe28a364f77717e8a1bc64cb79c8fa"
|
||||
)
|
||||
print("static CLI mixed and streamed sharded GGUF/KAR smokes passed")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user