Skip to content

Commit 839cdcd

Browse files
No public description
PiperOrigin-RevId: 824663603
1 parent be426fe commit 839cdcd

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

notebooks/Getting_started_with_google_colab_ai.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"cell_type": "markdown",
88
"source": [
9-
"Colab is making it easier than ever to integrate powerful Generative AI capabilities into your projects. We are launching public preview for a simple and intuitive Python library (google.colab.ai) to access state-of-the-art language models directly within Pro and Pro+ subscriber Colab environments. This means subscribers can spend less time on configuration and set up and more time bringing their ideas to life. With just a few lines of code, you can now perform a variety of tasks:\n",
9+
"Colab is making it easier than ever to integrate powerful Generative AI capabilities into your projects. We are launching public preview for a simple and intuitive Python library (google.colab.ai) to access state-of-the-art language models directly within Colab environments. All users have free access to most popular LLMs, while paid users have access to a wider selection of models. This means users can spend less time on configuration and set up and more time bringing their ideas to life. With just a few lines of code, you can now perform a variety of tasks:\n",
1010
"- Generate text\n",
1111
"- Translate languages\n",
1212
"- Write creative content\n",
@@ -98,7 +98,7 @@
9898
]
9999
}
100100
],
101-
"execution_count": 5
101+
"execution_count": null
102102
},
103103
{
104104
"metadata": {
@@ -126,7 +126,7 @@
126126
]
127127
}
128128
],
129-
"execution_count": 2
129+
"execution_count": null
130130
},
131131
{
132132
"metadata": {
@@ -200,33 +200,33 @@
200200
" def print(self, text_chunk):\n",
201201
" i = 0\n",
202202
" n = len(text_chunk)\n",
203-
" while i \u003c n:\n",
203+
" while i < n:\n",
204204
" start_index = i\n",
205-
" while i \u003c n and text_chunk[i] not in ' \\n': # Find end of word\n",
205+
" while i < n and text_chunk[i] not in ' \\n': # Find end of word\n",
206206
" i += 1\n",
207207
" current_word = text_chunk[start_index:i]\n",
208208
"\n",
209209
" delimiter = \"\"\n",
210-
" if i \u003c n: # If not end of chunk, we found a delimiter\n",
210+
" if i < n: # If not end of chunk, we found a delimiter\n",
211211
" delimiter = text_chunk[i]\n",
212212
" i += 1 # Consume delimiter\n",
213213
"\n",
214214
" if current_word:\n",
215-
" needs_leading_space = (self.current_line_length \u003e 0)\n",
215+
" needs_leading_space = (self.current_line_length > 0)\n",
216216
"\n",
217217
" # Case 1: Word itself is too long for a line (must be broken)\n",
218-
" if len(current_word) \u003e self.max_length:\n",
218+
" if len(current_word) > self.max_length:\n",
219219
" if needs_leading_space: # Newline if current line has content\n",
220220
" sys.stdout.write('\\n')\n",
221221
" self.current_line_length = 0\n",
222222
" for char_val in current_word: # Break the long word\n",
223-
" if self.current_line_length \u003e= self.max_length:\n",
223+
" if self.current_line_length >= self.max_length:\n",
224224
" sys.stdout.write('\\n')\n",
225225
" self.current_line_length = 0\n",
226226
" sys.stdout.write(char_val)\n",
227227
" self.current_line_length += 1\n",
228228
" # Case 2: Word doesn't fit on current line (print on new line)\n",
229-
" elif self.current_line_length + (1 if needs_leading_space else 0) + len(current_word) \u003e self.max_length:\n",
229+
" elif self.current_line_length + (1 if needs_leading_space else 0) + len(current_word) > self.max_length:\n",
230230
" sys.stdout.write('\\n')\n",
231231
" sys.stdout.write(current_word)\n",
232232
" self.current_line_length = len(current_word)\n",
@@ -254,7 +254,7 @@
254254
" self.current_line_length = 0\n",
255255
" elif delimiter == ' ':\n",
256256
" # If line is full and a space delimiter arrives, it implies a wrap.\n",
257-
" if self.current_line_length \u003e= self.max_length:\n",
257+
" if self.current_line_length >= self.max_length:\n",
258258
" sys.stdout.write('\\n')\n",
259259
" self.current_line_length = 0\n",
260260
"\n",

0 commit comments

Comments
 (0)