From 7b18970c91b357be1b665cc57f120c36f911c5ad Mon Sep 17 00:00:00 2001 From: Samaneh Saadat Date: Thu, 14 Mar 2024 01:13:54 +0000 Subject: [PATCH] Address review comments. --- keras_nlp/models/preprocessor.py | 2 +- keras_nlp/utils/preset_utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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)