Skip to content

Commit f1ef98c

Browse files
mridul-sahucopybara-github
authored andcommitted
Always write array metadata if self._array_metadata_store is not None.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#122 from AI-Hypercomputer:prepare_for_version 53e7715 PiperOrigin-RevId: 831268988
1 parent 1e1ae50 commit f1ef98c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pathwaysutils/persistence/orbax_handler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ async def serialize(
128128
)
129129
arrays.append(v)
130130

131-
metadata_coroutine = None
132-
if any_random_key:
133-
if self._array_metadata_store is None:
134-
raise ValueError(
135-
"Array metadata store is not set with a checkpoint that requires"
136-
f" it. Array metadata: {array_metadatas}"
137-
)
131+
if any_random_key and self._array_metadata_store is None:
132+
raise ValueError(
133+
"Array metadata store is not set with a checkpoint that requires"
134+
f" it. Array metadata: {array_metadatas}"
135+
)
138136

137+
metadata_coroutine = None
138+
if self._array_metadata_store is not None:
139139
metadata_coroutine = self._array_metadata_store.write(
140140
checkpoint_dir=infos[0].parent_dir,
141141
array_metadatas=array_metadatas,

0 commit comments

Comments
 (0)