GeezerVison is showing github.com — docs: update docs and tests for Gemini 2.5 models (#2279) · google/bigframes@08c0c0c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bigframes/ml/llm.py +18-4Lines changed: 18 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 54 | 54 | _GEMINI_2_FLASH_001_ENDPOINT = "gemini-2.0-flash-001" | 55 | 55 | _GEMINI_2_FLASH_LITE_001_ENDPOINT = "gemini-2.0-flash-lite-001" | 56 | 56 | _GEMINI_2P5_PRO_PREVIEW_ENDPOINT = "gemini-2.5-pro-preview-05-06" | | 57 | +_GEMINI_2P5_PRO_ENDPOINT = "gemini-2.5-pro" | | 58 | +_GEMINI_2P5_FLASH_ENDPOINT = "gemini-2.5-flash" | | 59 | +_GEMINI_2P5_FLASH_LITE_ENDPOINT = "gemini-2.5-flash-lite" | | 60 | + | 57 | 61 | _GEMINI_ENDPOINTS = ( | 58 | 62 | _GEMINI_1P5_PRO_PREVIEW_ENDPOINT, | 59 | 63 | _GEMINI_1P5_PRO_FLASH_PREVIEW_ENDPOINT, | | 64 | 68 | _GEMINI_2_FLASH_EXP_ENDPOINT, | 65 | 69 | _GEMINI_2_FLASH_001_ENDPOINT, | 66 | 70 | _GEMINI_2_FLASH_LITE_001_ENDPOINT, | | 71 | + _GEMINI_2P5_PRO_ENDPOINT, | | 72 | + _GEMINI_2P5_FLASH_ENDPOINT, | | 73 | + _GEMINI_2P5_FLASH_LITE_ENDPOINT, | 67 | 74 | ) | 68 | 75 | _GEMINI_PREVIEW_ENDPOINTS = ( | 69 | 76 | _GEMINI_1P5_PRO_PREVIEW_ENDPOINT, | | 84 | 91 | _GEMINI_2_FLASH_EXP_ENDPOINT, | 85 | 92 | _GEMINI_2_FLASH_001_ENDPOINT, | 86 | 93 | _GEMINI_2_FLASH_LITE_001_ENDPOINT, | | 94 | + _GEMINI_2P5_PRO_ENDPOINT, | | 95 | + _GEMINI_2P5_FLASH_ENDPOINT, | | 96 | + _GEMINI_2P5_FLASH_LITE_ENDPOINT, | 87 | 97 | ) | 88 | 98 |
| 89 | 99 | _CLAUDE_3_SONNET_ENDPOINT = "claude-3-sonnet" | @@ -419,20 +429,21 @@ class GeminiTextGenerator(base.RetriableRemotePredictor): | 419 | 429 | """Gemini text generator LLM model. | 420 | 430 |
| 421 | 431 | .. note:: | 422 | | - gemini-1.5-X are going to be deprecated. Use gemini-2.0-X (https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead. | | 432 | + gemini-1.5-X are going to be deprecated. Use gemini-2.5-X (https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead. | 423 | 433 |
| 424 | 434 | Args: | 425 | 435 | model_name (str, Default to "gemini-2.0-flash-001"): | 426 | 436 | The model for natural language tasks. Accepted values are | 427 | 437 | "gemini-1.5-pro-preview-0514", "gemini-1.5-flash-preview-0514", | 428 | 438 | "gemini-1.5-pro-001", "gemini-1.5-pro-002", "gemini-1.5-flash-001", | 429 | 439 | "gemini-1.5-flash-002", "gemini-2.0-flash-exp", | 430 | | - "gemini-2.0-flash-lite-001", and "gemini-2.0-flash-001". | | 440 | + "gemini-2.0-flash-lite-001", "gemini-2.0-flash-001", | | 441 | + "gemini-2.5-pro", "gemini-2.5-flash" and "gemini-2.5-flash-lite". | 431 | 442 | If no setting is provided, "gemini-2.0-flash-001" will be used by | 432 | 443 | default and a warning will be issued. | 433 | 444 |
| 434 | 445 | .. note:: | 435 | | - "gemini-1.5-X" is going to be deprecated. Please use gemini-2.0-X instead. For example, "gemini-2.0-flash-001". | | 446 | + "gemini-1.5-X" is going to be deprecated. Please use gemini-2.5-X instead. For example, "gemini-2.5-flash". | 436 | 447 | "gemini-2.0-flash-exp", "gemini-1.5-pro-preview-0514" and "gemini-1.5-flash-preview-0514" is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the | 437 | 448 | Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" | 438 | 449 | and might have limited support. For more information, see the launch stage descriptions | @@ -462,6 +473,9 @@ def __init__( | 462 | 473 | "gemini-2.0-flash-exp", | 463 | 474 | "gemini-2.0-flash-001", | 464 | 475 | "gemini-2.0-flash-lite-001", | | 476 | + "gemini-2.5-pro", | | 477 | + "gemini-2.5-flash", | | 478 | + "gemini-2.5-flash-lite", | 465 | 479 | ] | 466 | 480 | ] = None, | 467 | 481 | session: Optional[bigframes.Session] = None, | @@ -510,7 +524,7 @@ def _create_bqml_model(self): | 510 | 524 | msg = exceptions.format_message( | 511 | 525 | _MODEL_DEPRECATE_WARNING.format( | 512 | 526 | model_name=self.model_name, | 513 | | - new_model_name="gemini-2.0-X", | | 527 | + new_model_name="gemini-2.5-X", | 514 | 528 | link="https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator", | 515 | 529 | ) | 516 | 530 | ) | |
Collapse file Copy file name to clipboardExpand all lines: bigframes/ml/loader.py +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 67 | 67 | llm._GEMINI_2_FLASH_001_ENDPOINT: llm.GeminiTextGenerator, | 68 | 68 | llm._GEMINI_2_FLASH_LITE_001_ENDPOINT: llm.GeminiTextGenerator, | 69 | 69 | llm._GEMINI_2P5_PRO_PREVIEW_ENDPOINT: llm.GeminiTextGenerator, | | 70 | + llm._GEMINI_2P5_FLASH_ENDPOINT: llm.GeminiTextGenerator, | | 71 | + llm._GEMINI_2P5_FLASH_LITE_ENDPOINT: llm.GeminiTextGenerator, | | 72 | + llm._GEMINI_2P5_PRO_ENDPOINT: llm.GeminiTextGenerator, | 70 | 73 | llm._CLAUDE_3_HAIKU_ENDPOINT: llm.Claude3TextGenerator, | 71 | 74 | llm._CLAUDE_3_SONNET_ENDPOINT: llm.Claude3TextGenerator, | 72 | 75 | llm._CLAUDE_3_5_SONNET_ENDPOINT: llm.Claude3TextGenerator, | |
Collapse file Copy file name to clipboardExpand all lines: tests/system/small/ml/test_llm.py +16-1Lines changed: 16 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -111,6 +111,9 @@ def test_create_load_multimodal_embedding_generator_model( | 111 | 111 | "gemini-2.0-flash-exp", | 112 | 112 | "gemini-2.0-flash-001", | 113 | 113 | "gemini-2.0-flash-lite-001", | | 114 | + "gemini-2.5-pro", | | 115 | + "gemini-2.5-flash", | | 116 | + "gemini-2.5-flash-lite", | 114 | 117 | ), | 115 | 118 | ) | 116 | 119 | @pytest.mark.flaky( | @@ -140,9 +143,12 @@ def test_create_load_gemini_text_generator_model( | 140 | 143 | "gemini-2.0-flash-exp", | 141 | 144 | "gemini-2.0-flash-001", | 142 | 145 | "gemini-2.0-flash-lite-001", | | 146 | + "gemini-2.5-pro", | | 147 | + "gemini-2.5-flash", | | 148 | + "gemini-2.5-flash-lite", | 143 | 149 | ), | 144 | 150 | ) | 145 | | -@pytest.mark.flaky(retries=2) | | 151 | +# @pytest.mark.flaky(retries=2) | 146 | 152 | def test_gemini_text_generator_predict_default_params_success( | 147 | 153 | llm_text_df, model_name, session, bq_connection | 148 | 154 | ): | @@ -161,6 +167,9 @@ def test_gemini_text_generator_predict_default_params_success( | 161 | 167 | "gemini-2.0-flash-exp", | 162 | 168 | "gemini-2.0-flash-001", | 163 | 169 | "gemini-2.0-flash-lite-001", | | 170 | + "gemini-2.5-pro", | | 171 | + "gemini-2.5-flash", | | 172 | + "gemini-2.5-flash-lite", | 164 | 173 | ), | 165 | 174 | ) | 166 | 175 | @pytest.mark.flaky(retries=2) | @@ -184,6 +193,9 @@ def test_gemini_text_generator_predict_with_params_success( | 184 | 193 | "gemini-2.0-flash-exp", | 185 | 194 | "gemini-2.0-flash-001", | 186 | 195 | "gemini-2.0-flash-lite-001", | | 196 | + "gemini-2.5-pro", | | 197 | + "gemini-2.5-flash", | | 198 | + "gemini-2.5-flash-lite", | 187 | 199 | ), | 188 | 200 | ) | 189 | 201 | @pytest.mark.flaky(retries=2) | @@ -209,6 +221,9 @@ def test_gemini_text_generator_multi_cols_predict_success( | 209 | 221 | "gemini-2.0-flash-exp", | 210 | 222 | "gemini-2.0-flash-001", | 211 | 223 | "gemini-2.0-flash-lite-001", | | 224 | + "gemini-2.5-pro", | | 225 | + "gemini-2.5-flash", | | 226 | + "gemini-2.5-flash-lite", | 212 | 227 | ), | 213 | 228 | ) | 214 | 229 | @pytest.mark.flaky(retries=2) | |
|