route refmods per generated chunk
This commit is contained in:
+19
-1
@@ -185,7 +185,25 @@ def _add_direct_refmod_input(node_class):
|
||||
scramble_mode="shuffle",
|
||||
max_total_tokens=int(refmod_max_total_tokens),
|
||||
)
|
||||
kwargs["model"] = bridge.attach(model, blocks, enabled=True)
|
||||
chunk_blocks = None
|
||||
chunk_refs = getattr(refmods, "chunk_refs", None)
|
||||
if chunk_refs:
|
||||
# Build the per-chunk payloads from the same selected
|
||||
# RefMods. Ordinary H3_REF_MODS lists have no routing
|
||||
# metadata and retain the upstream all-chunks behavior.
|
||||
chunk_blocks = []
|
||||
for positions in chunk_refs:
|
||||
chunk_mods = [refmods[index] for index in positions]
|
||||
chunk_blocks.append(pack._ref_blocks(
|
||||
chunk_mods,
|
||||
refmod_retention,
|
||||
seed=-1,
|
||||
scramble_mode="shuffle",
|
||||
max_total_tokens=int(refmod_max_total_tokens),
|
||||
))
|
||||
kwargs["model"] = bridge.attach(
|
||||
model, blocks, enabled=True, chunk_blocks=chunk_blocks,
|
||||
)
|
||||
print(
|
||||
"[DUMAS H3 Continuum Sampler V3.9] direct RefMods active "
|
||||
f"({len(blocks)} block(s))"
|
||||
|
||||
Reference in New Issue
Block a user