diff --git a/keras_nlp/models/preprocessor.py b/keras_nlp/models/preprocessor.py index c825767ac8..ac47925b48 100644 --- a/keras_nlp/models/preprocessor.py +++ b/keras_nlp/models/preprocessor.py @@ -102,7 +102,7 @@ def save_to_preset( preset, config_filename="tokenizer.json", ): - save_to_preset(self, preset, config_filename=config_filename) + save_to_preset(self.tokenizer, preset, config_filename=config_filename) def __init_subclass__(cls, **kwargs): # Use __init_subclass__ to setup a correct docstring for from_preset. diff --git a/keras_nlp/utils/preset_utils.py b/keras_nlp/utils/preset_utils.py index 3d62d46d6d..99f43914dc 100644 --- a/keras_nlp/utils/preset_utils.py +++ b/keras_nlp/utils/preset_utils.py @@ -16,6 +16,7 @@ import json import os +from keras_nlp.api_export import keras_nlp_export from keras_nlp.backend import config as backend_config from keras_nlp.backend import keras @@ -155,9 +156,10 @@ def save_to_preset( metadata_file.write(json.dumps(metadata, indent=4)) +@keras_nlp_export("keras_nlp.upload_preset") def upload_preset( - preset, uri, + preset, ): if uri.startswith(KAGGLE_PREFIX): kaggle_handle = uri.removeprefix(KAGGLE_PREFIX)