Skip to content

Commit 5c63641

Browse files
committed
change the model from gemini-2.0-flash-exp to gemini-1.5-flash-002
1 parent 41ac8ab commit 5c63641

11 files changed

+60
-64
lines changed

bigframes/ml/llm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,12 +934,11 @@ class GeminiTextGenerator(base.RetriableRemotePredictor):
934934
The model for natural language tasks. Accepted values are "gemini-pro", "gemini-1.5-pro-preview-0514", "gemini-1.5-flash-preview-0514", "gemini-1.5-pro-001", "gemini-1.5-pro-002", "gemini-1.5-flash-001", "gemini-1.5-flash-002" and "gemini-2.0-flash-exp". Default to "gemini-pro".
935935
936936
.. note::
937-
"gemini-pro" is going to be deprecated. Will change to gemini-2.0-X for Bigframes 2.
937+
"gemini-pro" is going to be deprecated. Bigframes 2 will transition to using gemini-2.0-X.
938938
"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
939939
Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is"
940940
and might have limited support. For more information, see the launch stage descriptions
941941
(https://cloud.google.com/products#product-launch-stages).
942-
"
943942
944943
session (bigframes.Session or None):
945944
BQ session to create the model. If None, use the global default session.

notebooks/apps/synthetic_data_generation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"source": [
112112
"from bigframes.ml.llm import GeminiTextGenerator\n",
113113
"\n",
114-
"model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")"
114+
"model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
115115
]
116116
},
117117
{

notebooks/generative_ai/bq_dataframes_llm_code_generation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@
430430
"source": [
431431
"from bigframes.ml.llm import GeminiTextGenerator\n",
432432
"\n",
433-
"model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")"
433+
"model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
434434
]
435435
},
436436
{

notebooks/generative_ai/bq_dataframes_llm_gemini_2.ipynb

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"cell_type": "markdown",
5757
"metadata": {},
5858
"source": [
59-
"### Create Gemini 2.0 experimental Model with model_name as \"gemini-2.0-flash-exp\""
59+
"### Create Gemini 2.0 experimental Model with model_name as \"gemini-1.5-flash-002\""
6060
]
6161
},
6262
{
@@ -68,19 +68,28 @@
6868
"name": "stderr",
6969
"output_type": "stream",
7070
"text": [
71-
"/usr/local/google/home/garrettwu/src/bigframes/bigframes/ml/llm.py:803: PreviewWarning: Model gemini-2.0-flash-exp is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section of the\n",
72-
" Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available \"as is\"\n",
73-
" and might have limited support. For more information, see the launch stage descriptions\n",
74-
" (https://cloud.google.com/products#product-launch-stages).\n",
75-
" warnings.warn(\n",
76-
"/usr/local/google/home/garrettwu/src/bigframes/bigframes/pandas/__init__.py:435: DefaultLocationWarning: No explicit location is set, so using location US for the session.\n",
77-
" return global_session.get_global_session()\n"
71+
"/tmp/ipykernel_604828/1304092015.py:1: ApiDeprecationWarning: gemini-pro and 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. \n",
72+
" model = llm.GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")\n",
73+
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/ml/llm.py:981: DefaultLocationWarning: No explicit location is set, so using location US for the session.\n",
74+
" self.session = session or global_session.get_global_session()\n"
7875
]
7976
},
8077
{
8178
"data": {
8279
"text/html": [
83-
"Query job f673a2ea-023e-4771-84a2-fb81f808fa1b is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:f673a2ea-023e-4771-84a2-fb81f808fa1b&page=queryresults\">Open Job</a>"
80+
"Query job 3f32129b-5f71-4c08-b572-6c7eed201877 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:3f32129b-5f71-4c08-b572-6c7eed201877&page=queryresults\">Open Job</a>"
81+
],
82+
"text/plain": [
83+
"<IPython.core.display.HTML object>"
84+
]
85+
},
86+
"metadata": {},
87+
"output_type": "display_data"
88+
},
89+
{
90+
"data": {
91+
"text/html": [
92+
"Query job 5fb1fa6f-32aa-43c8-b002-c0c21caaaaca is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:5fb1fa6f-32aa-43c8-b002-c0c21caaaaca&page=queryresults\">Open Job</a>"
8493
],
8594
"text/plain": [
8695
"<IPython.core.display.HTML object>"
@@ -91,7 +100,7 @@
91100
}
92101
],
93102
"source": [
94-
"model = llm.GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")"
103+
"model = llm.GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
95104
]
96105
},
97106
{
@@ -369,7 +378,7 @@
369378
"name": "python",
370379
"nbconvert_exporter": "python",
371380
"pygments_lexer": "ipython3",
372-
"version": "3.10.14"
381+
"version": "3.10.15"
373382
}
374383
},
375384
"nbformat": 4,

notebooks/generative_ai/bq_dataframes_llm_kmeans.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@
16141614
"source": [
16151615
"from bigframes.ml.llm import GeminiTextGenerator\n",
16161616
"\n",
1617-
"q_a_model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")"
1617+
"q_a_model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
16181618
]
16191619
},
16201620
{

notebooks/generative_ai/bq_dataframes_ml_drug_name_generation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@
581581
],
582582
"source": [
583583
"# Define the model\n",
584-
"model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")\n",
584+
"model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")\n",
585585
"\n",
586586
"# Invoke LLM with prompt\n",
587587
"response = predict(zero_shot_prompt, temperature = TEMPERATURE)\n",

notebooks/generative_ai/large_language_models.ipynb

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 2,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -21,30 +21,23 @@
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": 3,
24+
"execution_count": 2,
2525
"metadata": {},
2626
"outputs": [
2727
{
2828
"name": "stderr",
2929
"output_type": "stream",
3030
"text": [
31-
"/tmp/ipykernel_207955/1337909476.py:1: ApiDeprecationWarning: gemini-1.0-X and 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. \n",
32-
" model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")\n",
33-
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/ml/llm.py:978: PreviewWarning: Model gemini-2.0-flash-exp is subject to the \"Pre-GA Offerings Terms\"\n",
34-
"in the General Service Terms section of the Service Specific\n",
35-
"Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products\n",
36-
"and features are available \"as is\" and might have limited support. For\n",
37-
"more information, see the launch stage descriptions\n",
38-
"(https://cloud.google.com/products#product-launch-stages).\n",
39-
" warnings.warn(msg, category=exceptions.PreviewWarning)\n",
40-
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/ml/llm.py:980: DefaultLocationWarning: No explicit location is set, so using location US for the session.\n",
31+
"/tmp/ipykernel_604997/3896046356.py:1: ApiDeprecationWarning: gemini-pro and 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. \n",
32+
" model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")\n",
33+
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/ml/llm.py:981: DefaultLocationWarning: No explicit location is set, so using location US for the session.\n",
4134
" self.session = session or global_session.get_global_session()\n"
4235
]
4336
},
4437
{
4538
"data": {
4639
"text/html": [
47-
"Query job 77cfcb56-5731-4403-a227-4ff09639a953 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:77cfcb56-5731-4403-a227-4ff09639a953&page=queryresults\">Open Job</a>"
40+
"Query job dd2da3cc-27c3-4c6f-9936-4f7769c85090 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:dd2da3cc-27c3-4c6f-9936-4f7769c85090&page=queryresults\">Open Job</a>"
4841
],
4942
"text/plain": [
5043
"<IPython.core.display.HTML object>"
@@ -56,7 +49,7 @@
5649
{
5750
"data": {
5851
"text/html": [
59-
"Query job f4ede566-536f-4007-8948-30c3eb23711f is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:f4ede566-536f-4007-8948-30c3eb23711f&page=queryresults\">Open Job</a>"
52+
"Query job 00947011-4d7c-42fa-ae19-3b684976cec6 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:00947011-4d7c-42fa-ae19-3b684976cec6&page=queryresults\">Open Job</a>"
6053
],
6154
"text/plain": [
6255
"<IPython.core.display.HTML object>"
@@ -67,7 +60,7 @@
6760
}
6861
],
6962
"source": [
70-
"model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")"
63+
"model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
7164
]
7265
},
7366
{

notebooks/getting_started/bq_dataframes_template.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@
13671367
"source": [
13681368
"# from bigframes.ml.llm import GeminiTextGenerator\n",
13691369
"\n",
1370-
"# model = GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")\n",
1370+
"# model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")\n",
13711371
"\n",
13721372
"# pred = model.predict(df)\n",
13731373
"# pred"

samples/snippets/gemini_model_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_gemini_text_generator_model() -> None:
3030
session = bpd.get_global_session()
3131
connection = f"{PROJECT_ID}.{REGION}.{CONN_NAME}"
3232
model = GeminiTextGenerator(
33-
session=session, connection_name=connection, model_name="gemini-2.0-flash-exp"
33+
session=session, connection_name=connection, model_name="gemini-1.5-flash-002"
3434
)
3535

3636
df_api = bpd.read_csv("gs://cloud-samples-data/vertex-ai/bigframe/df.csv")

tests/system/load/test_llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_llm_gemini_configure_fit(
7979

8080
@pytest.mark.flaky(retries=2)
8181
def test_llm_gemini_w_ground_with_google_search(llm_remote_text_df):
82-
model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-exp", max_iterations=1)
82+
model = llm.GeminiTextGenerator(model_name="gemini-1.5-flash-002", max_iterations=1)
8383
df = model.predict(
8484
llm_remote_text_df["prompt"],
8585
ground_with_google_search=True,

0 commit comments

Comments
 (0)