Skip to content

Commit c5772c2

Browse files
justinchubyCopilot
andcommitted
Preserve multi-shard imports with GGUF reuse
Reject external-byte reuse for split GGUF sets before accessing single-file storage metadata. Normal multi-shard builds continue through the current main path unchanged. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
1 parent c2af3f2 commit c5772c2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/mobius/integrations/gguf/_builder.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def build_from_gguf(
544544
GGUF_ARCH_TO_MODEL_TYPE,
545545
gguf_to_config,
546546
)
547-
from mobius.integrations.gguf._shard_set import open_gguf_model
547+
from mobius.integrations.gguf._shard_set import GgufShardSet, open_gguf_model
548548
from mobius.integrations.gguf._tensor_processors import (
549549
process_tensors,
550550
)
@@ -569,6 +569,11 @@ def build_from_gguf(
569569
gguf_path = _resolve_gguf_path(gguf_path)
570570
gguf_model = open_gguf_model(gguf_path)
571571
_validate_gguf_model(gguf_model, source=str(gguf_path))
572+
if reuse_gguf_weights and isinstance(gguf_model, GgufShardSet):
573+
raise ValueError(
574+
"reuse_gguf_weights=True does not yet support multi-shard GGUF sets. "
575+
"Build without reuse to preserve current multi-shard import behavior."
576+
)
572577
if reuse_gguf_weights and not gguf_model.is_little_endian:
573578
raise ValueError(
574579
"reuse_gguf_weights=True requires a little-endian GGUF because ONNX "

0 commit comments

Comments
 (0)