MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / _read_phase2_meta

Method _read_phase2_meta

lightx2v/disagg/services/decoder.py:227–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 if len(room_buffers) < 2:
226 raise RuntimeError("Phase2 RDMA buffers require [latents, meta] entries.")
227
228 meta_buf = room_buffers[1]
229
230 def _read_phase2_meta() -> tuple[dict, str]:
231 meta_bytes = _buffer_view(meta_buf, torch.uint8, (meta_buf.numel(),)).detach().contiguous().cpu().numpy().tobytes()
232 meta_str = meta_bytes.split(b"\x00", 1)[0].decode("utf-8", errors="ignore") if meta_bytes else ""
233 if not meta_str:
234 raise ValueError("missing latents metadata from transformer")
235 parsed = json.loads(meta_str)
236 if not isinstance(parsed, dict):
237 raise ValueError(f"phase2 metadata type mismatch: {type(parsed)}")
238 return parsed, meta_str

Callers

nothing calls this directly

Calls 3

_buffer_viewFunction · 0.85
cpuMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected