-
Notifications
You must be signed in to change notification settings - Fork 468
fix(examples): migrate basics_colab and agents_colab notebooks from granite3.3 to granite4.1:8b #1540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(examples): migrate basics_colab and agents_colab notebooks from granite3.3 to granite4.1:8b #1540
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -256,13 +256,13 @@ | |
| ] | ||
| }, | ||
| { | ||
| "metadata": {}, | ||
| "cell_type": "code", | ||
| "outputs": [], | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# Construct ChatModel\n", | ||
| "model = ChatModel.from_name(\"ollama:granite3.3\")\n", | ||
| "model = ChatModel.from_name(\"ollama:granite4.1:8b\")\n", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a mismatch between the model being pulled in the installation cell and the model instantiated here. The installation cell (around line 73) pulls |
||
| "\n", | ||
| "question1 = \"Briefly explain quantum computing in simple terms with an example.\"\n", | ||
| "message = UserMessage(content=question1)\n", | ||
|
|
@@ -274,10 +274,10 @@ | |
| ] | ||
| }, | ||
| { | ||
| "metadata": {}, | ||
| "cell_type": "code", | ||
| "outputs": [], | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "question2 = \"Hello! Can you tell me what is the capital of France?\"\n", | ||
| "message = UserMessage(content=question2)\n", | ||
|
|
@@ -305,10 +305,10 @@ | |
| ] | ||
| }, | ||
| { | ||
| "metadata": {}, | ||
| "cell_type": "code", | ||
| "outputs": [], | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "memory = UnconstrainedMemory()\n", | ||
| "question3 = \"If you had to recommend one thing to do there, what would it be?\"\n", | ||
|
|
@@ -341,10 +341,10 @@ | |
| ] | ||
| }, | ||
| { | ||
| "metadata": {}, | ||
| "cell_type": "code", | ||
| "outputs": [], | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# Some context that the model will use to provide an answer. Source wikipedia: https://en.wikipedia.org/wiki/Ireland\n", | ||
| "context = \"\"\"The geography of Ireland comprises relatively low-lying mountains surrounding a central plain, with several navigable rivers extending inland.\n", | ||
|
|
@@ -381,10 +381,10 @@ | |
| ] | ||
| }, | ||
| { | ||
| "metadata": {}, | ||
| "cell_type": "code", | ||
| "outputs": [], | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# The output structure definition, note the field descriptions that can help the LLM to understand the intention of the field.\n", | ||
| "class CharacterSchema(BaseModel):\n", | ||
|
|
@@ -421,10 +421,10 @@ | |
| ] | ||
| }, | ||
| { | ||
| "metadata": {}, | ||
| "cell_type": "code", | ||
| "outputs": [], | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "pirate_message = \"You are pirate. You always respond using pirate slang.\"\n", | ||
| "system_message = SystemMessage(content=pirate_message)\n", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a mismatch between the model being pulled in the installation cell and the model instantiated here. The installation cell (around line 78) pulls
granite3.3:8b(!ollama pull granite3.3:8b), but this cell instantiatesgranite4.1:8b. This will cause a runtime error or unexpected delay when running the notebook in Google Colab because the correct model is not pre-pulled. Please update the installation cell to pullgranite4.1:8bas well.