MCPcopy Create free account
hub / github.com/Robbyant/lingbot-map / _squeeze_single_batch

Function _squeeze_single_batch

demo.py:268–275  ·  view source on GitHub ↗

Drop the leading batch dimension for single-sequence demo outputs.

(key, value)

Source from the content-addressed store, hash-verified

266
267
268def _squeeze_single_batch(key, value):
269 """Drop the leading batch dimension for single-sequence demo outputs."""
270 batched_ndim = _BATCHED_NDIMS.get(key)
271 if batched_ndim is None or not hasattr(value, "ndim"):
272 return value
273 if value.ndim == batched_ndim and value.shape[0] == 1:
274 return value[0]
275 return value
276
277
278def postprocess(predictions, images):

Callers 2

postprocessFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected