Skip to content

Commit 6b3adf2

Browse files
committed
Reverted file to commit bdcb1e7
1 parent 58bfd09 commit 6b3adf2

File tree

1 file changed

+37
-44
lines changed

1 file changed

+37
-44
lines changed

notebooks/generative_ai/bq_dataframes_llm_gemini_2.ipynb

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": 2,
47+
"execution_count": 3,
4848
"metadata": {},
4949
"outputs": [],
5050
"source": [
@@ -56,40 +56,31 @@
5656
"cell_type": "markdown",
5757
"metadata": {},
5858
"source": [
59-
"### Create Gemini 2.0 experimental Model with model_name as \"gemini-1.5-flash-002\""
59+
"### Create Gemini 2.0 experimental Model with model_name as \"gemini-2.0-flash-exp\""
6060
]
6161
},
6262
{
6363
"cell_type": "code",
64-
"execution_count": 3,
64+
"execution_count": 4,
6565
"metadata": {},
6666
"outputs": [
6767
{
6868
"name": "stderr",
6969
"output_type": "stream",
7070
"text": [
71-
"/tmp/ipykernel_610113/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"
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"
7578
]
7679
},
7780
{
7881
"data": {
7982
"text/html": [
80-
"Query job f9b52257-1c5a-4bb9-a619-60d7cb5cee79 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:f9b52257-1c5a-4bb9-a619-60d7cb5cee79&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 592a26f7-e355-4e67-947b-f5614c34690e is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:592a26f7-e355-4e67-947b-f5614c34690e&page=queryresults\">Open Job</a>"
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>"
9384
],
9485
"text/plain": [
9586
"<IPython.core.display.HTML object>"
@@ -100,7 +91,7 @@
10091
}
10192
],
10293
"source": [
103-
"model = llm.GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
94+
"model = llm.GeminiTextGenerator(model_name=\"gemini-2.0-flash-exp\")"
10495
]
10596
},
10697
{
@@ -112,13 +103,13 @@
112103
},
113104
{
114105
"cell_type": "code",
115-
"execution_count": 4,
106+
"execution_count": 5,
116107
"metadata": {},
117108
"outputs": [
118109
{
119110
"data": {
120111
"text/html": [
121-
"Query job 6cdfea0f-1957-4cd0-a358-d3846b2ddee1 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:6cdfea0f-1957-4cd0-a358-d3846b2ddee1&page=queryresults\">Open Job</a>"
112+
"Query job 2276ea5b-2e08-4ed6-af34-49a7d165d145 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:2276ea5b-2e08-4ed6-af34-49a7d165d145&page=queryresults\">Open Job</a>"
122113
],
123114
"text/plain": [
124115
"<IPython.core.display.HTML object>"
@@ -168,7 +159,7 @@
168159
"[1 rows x 1 columns]"
169160
]
170161
},
171-
"execution_count": 4,
162+
"execution_count": 5,
172163
"metadata": {},
173164
"output_type": "execute_result"
174165
}
@@ -187,13 +178,13 @@
187178
},
188179
{
189180
"cell_type": "code",
190-
"execution_count": 5,
181+
"execution_count": 6,
191182
"metadata": {},
192183
"outputs": [
193184
{
194185
"data": {
195186
"text/html": [
196-
"Query job 06ce82fd-3041-42ec-848a-92757aece70f is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:06ce82fd-3041-42ec-848a-92757aece70f&page=queryresults\">Open Job</a>"
187+
"Query job 9ba21e96-6023-491e-8e83-f2e6fa7df0e7 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:9ba21e96-6023-491e-8e83-f2e6fa7df0e7&page=queryresults\">Open Job</a>"
197188
],
198189
"text/plain": [
199190
"<IPython.core.display.HTML object>"
@@ -206,15 +197,14 @@
206197
"name": "stderr",
207198
"output_type": "stream",
208199
"text": [
209-
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/core/array_value.py:114: PreviewWarning: JSON column interpretation as a custom PyArrow extention in\n",
210-
"`db_dtypes` is a preview feature and subject to change.\n",
211-
" warnings.warn(msg, bfe.PreviewWarning)\n"
200+
"/usr/local/google/home/garrettwu/src/bigframes/bigframes/core/__init__.py:109: PreviewWarning: Interpreting JSON column(s) as StringDtype. This behavior may change in future versions.\n",
201+
" warnings.warn(\n"
212202
]
213203
},
214204
{
215205
"data": {
216206
"text/html": [
217-
"Query job 0b7f4fad-4793-4187-866a-ad45d1b8b49c is DONE. 606 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:0b7f4fad-4793-4187-866a-ad45d1b8b49c&page=queryresults\">Open Job</a>"
207+
"Query job 933d45cc-4bc0-4bdf-b4b8-573da2d58be3 is DONE. 2 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:933d45cc-4bc0-4bdf-b4b8-573da2d58be3&page=queryresults\">Open Job</a>"
218208
],
219209
"text/plain": [
220210
"<IPython.core.display.HTML object>"
@@ -226,7 +216,7 @@
226216
{
227217
"data": {
228218
"text/html": [
229-
"Query job 5774da7a-23cb-45e8-bf6a-87d7ee2ebacd is DONE. 614 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:5774da7a-23cb-45e8-bf6a-87d7ee2ebacd&page=queryresults\">Open Job</a>"
219+
"Query job 3dda9bc6-84b1-4f4a-8891-85d25d8848ce is DONE. 4.3 kB processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:3dda9bc6-84b1-4f4a-8891-85d25d8848ce&page=queryresults\">Open Job</a>"
230220
],
231221
"text/plain": [
232222
"<IPython.core.display.HTML object>"
@@ -265,7 +255,7 @@
265255
" <tbody>\n",
266256
" <tr>\n",
267257
" <th>0</th>\n",
268-
" <td>There's no officially recognized technology or...</td>\n",
258+
" <td>Alright, let's talk about Gemini 2.0! It's a b...</td>\n",
269259
" <td>&lt;NA&gt;</td>\n",
270260
" <td></td>\n",
271261
" <td>Tell me something about Gemini 2.0.</td>\n",
@@ -277,7 +267,7 @@
277267
],
278268
"text/plain": [
279269
" ml_generate_text_llm_result \\\n",
280-
"0 There's no officially recognized technology or... \n",
270+
"0 Alright, let's talk about Gemini 2.0! It's a b... \n",
281271
"\n",
282272
" ml_generate_text_rai_result ml_generate_text_status \\\n",
283273
"0 <NA> \n",
@@ -288,7 +278,7 @@
288278
"[1 rows x 4 columns]"
289279
]
290280
},
291-
"execution_count": 5,
281+
"execution_count": 6,
292282
"metadata": {},
293283
"output_type": "execute_result"
294284
}
@@ -307,13 +297,13 @@
307297
},
308298
{
309299
"cell_type": "code",
310-
"execution_count": 6,
300+
"execution_count": 7,
311301
"metadata": {},
312302
"outputs": [
313303
{
314304
"data": {
315305
"text/html": [
316-
"Copy job 8fe43863-54be-4c8a-b2b3-5fdba16a1bc0 is DONE. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:8fe43863-54be-4c8a-b2b3-5fdba16a1bc0&page=queryresults\">Open Job</a>"
306+
"Copy job 8e68af62-e7ab-475b-99c9-b79e8ba3c40b is DONE. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:8e68af62-e7ab-475b-99c9-b79e8ba3c40b&page=queryresults\">Open Job</a>"
317307
],
318308
"text/plain": [
319309
"<IPython.core.display.HTML object>"
@@ -326,14 +316,17 @@
326316
"name": "stderr",
327317
"output_type": "stream",
328318
"text": [
329-
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/ml/llm.py:1023: 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",
330-
" model = cls(\n"
319+
"/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",
320+
" Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available \"as is\"\n",
321+
" and might have limited support. For more information, see the launch stage descriptions\n",
322+
" (https://cloud.google.com/products#product-launch-stages).\n",
323+
" warnings.warn(\n"
331324
]
332325
},
333326
{
334327
"data": {
335328
"text/html": [
336-
"Query job eed27608-273f-45b2-bb2e-12e1b42c5c04 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:eed27608-273f-45b2-bb2e-12e1b42c5c04&page=queryresults\">Open Job</a>"
329+
"Query job cae7f929-d8cb-4819-a644-ac832cdc0912 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:cae7f929-d8cb-4819-a644-ac832cdc0912&page=queryresults\">Open Job</a>"
337330
],
338331
"text/plain": [
339332
"<IPython.core.display.HTML object>"
@@ -345,12 +338,12 @@
345338
{
346339
"data": {
347340
"text/plain": [
348-
"GeminiTextGenerator(connection_name='bigframes-dev.US.bigframes-default-connection',\n",
349-
" model_name='gemini-1.5-flash-002',\n",
350-
" session=<bigframes.session.Session object at 0x7f38e5eab7c0>)"
341+
"GeminiTextGenerator(connection_name='bigframes-dev.us.bigframes-rf-connection',\n",
342+
" model_name='gemini-2.0-flash-exp',\n",
343+
" session=<bigframes.session.Session object at 0x7f8210630370>)"
351344
]
352345
},
353-
"execution_count": 6,
346+
"execution_count": 7,
354347
"metadata": {},
355348
"output_type": "execute_result"
356349
}
@@ -376,7 +369,7 @@
376369
"name": "python",
377370
"nbconvert_exporter": "python",
378371
"pygments_lexer": "ipython3",
379-
"version": "3.10.15"
372+
"version": "3.10.14"
380373
}
381374
},
382375
"nbformat": 4,

0 commit comments

Comments
 (0)