Skip to content

Commit 97f05bf

Browse files
hejiang0116Orbax Authors
authored andcommitted
Internal
PiperOrigin-RevId: 970142718
1 parent 18c419d commit 97f05bf

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

export/orbax/export/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ class ExportModelType(enum.Enum):
9595
# Jax2obm_kwargs key for the loader type.
9696
LOADER_TYPE = 'loader_type'
9797

98+
# SaveOptions extra_options key for TensorFlow SavedModel save options.
99+
TF_SAVE_OPTIONS = 'tf_save_options'
100+
98101
################################################################################
99102
# Proto field names
100103
################################################################################

export/orbax/export/export_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,17 @@ def serving_signatures(self) -> Mapping[str, Callable[..., Any]]:
118118
def save(
119119
self,
120120
model_path: str,
121-
save_options: Optional[tf.saved_model.SaveOptions] = None,
121+
save_options: Optional[
122+
tf.saved_model.SaveOptions
123+
]=None,
122124
signature_overrides: Optional[Mapping[str, Callable[..., Any]]] = None,
123125
):
124126
"""Saves the JAX model to a Savemodel.
125127
126128
Args:
127129
model_path: a directory in which to write the SavedModel.
128-
save_options: an optional tf.saved_model.SaveOptions for configuring save
129-
options.
130+
save_options: an optional tf.saved_model.SaveOptions or obm.SaveOptions for
131+
configuring save options.
130132
signature_overrides: signatures to override the self-maintained ones, or
131133
additional signatures to export.
132134
"""

export/orbax/export/export_manager_obm_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""Tests for the `version==ORBAX_MODEL` path of `ExportManager`."""
1616

1717
import os
18+
from unittest import mock
1819

1920
from absl.testing import absltest
2021
from absl.testing import parameterized

0 commit comments

Comments
 (0)