MCPcopy Create free account
hub / github.com/openai/point-e / open_array

Function open_array

point_e/evals/npz_stream.py:260–266  ·  view source on GitHub ↗
(path: str, arr_name: str)

Source from the content-addressed store, hash-verified

258
259@contextmanager
260def open_array(path: str, arr_name: str):
261 with open(path, "rb") as f:
262 with zipfile.ZipFile(f, "r") as zip_f:
263 if f"{arr_name}.npy" not in zip_f.namelist():
264 raise ValueError(f"missing {arr_name} in npz file")
265 with zip_f.open(f"{arr_name}.npy", "r") as arr_f:
266 yield arr_f
267
268
269def _dict_batch_size(objs: Dict[str, np.ndarray]) -> int:

Callers 1

open_npz_arraysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected