From 90d32f58d1401f6bef92fbeccefbe4409e95bcf0 Mon Sep 17 00:00:00 2001 From: Garrett Wu Date: Tue, 1 Oct 2024 19:59:46 +0000 Subject: [PATCH] feat: add deprecation warning to PaLM2TextGenerator model --- bigframes/ml/llm.py | 7 +++++++ tests/system/small/ml/test_llm.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/bigframes/ml/llm.py b/bigframes/ml/llm.py index 36b5955e83..c12da01b54 100644 --- a/bigframes/ml/llm.py +++ b/bigframes/ml/llm.py @@ -84,10 +84,17 @@ _ML_GENERATE_EMBEDDING_STATUS = "ml_generate_embedding_status" +@typing_extensions.deprecated( + "PaLM2TextGenerator is going to be deprecated. Use GeminiTextGenerator(https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead. ", + category=exceptions.ApiDeprecationWarning, +) @log_adapter.class_logger class PaLM2TextGenerator(base.BaseEstimator): """PaLM2 text generator LLM model. + .. note:: + PaLM2TextGenerator is going to be deprecated. Use GeminiTextGenerator(https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead. + Args: model_name (str, Default to "text-bison"): The model for natural language tasks. “text-bison” returns model fine-tuned to follow natural language instructions diff --git a/tests/system/small/ml/test_llm.py b/tests/system/small/ml/test_llm.py index 73a77e6bdd..78fed6b82f 100644 --- a/tests/system/small/ml/test_llm.py +++ b/tests/system/small/ml/test_llm.py @@ -450,6 +450,11 @@ def test_llm_gemini_pro_score_params(llm_fine_tune_df_default_index): ) +def test_palm2_text_generator_deprecated(): + with pytest.warns(exceptions.ApiDeprecationWarning): + llm.PaLM2TextGenerator() + + def test_palm2_text_embedding_deprecated(): with pytest.warns(exceptions.ApiDeprecationWarning): try: