Skip to content

Commit cdd3dd8

Browse files
committed
Add jupyter notebook tests to Github CI tests
1 parent 6cdb451 commit cdd3dd8

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/build_and_test_maxtext.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
echo "No files changed"
6868
echo "run_tests=true" >> $GITHUB_OUTPUT
6969
echo "run_notebooks=true" >> $GITHUB_OUTPUT
70+
exit 0
7071
fi
7172
7273
# Check for source code changes (anything not .md and not .ipynb)
@@ -87,6 +88,8 @@ jobs:
8788
echo "run_notebooks=false" >> $GITHUB_OUTPUT
8889
fi
8990
91+
exit 0
92+
9093
build_and_upload_maxtext_package:
9194
needs: doc_only_check
9295
# Run if either tests or notebooks need to run

src/MaxText/examples/rl_llama3_demo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
"name": "python",
364364
"nbconvert_exporter": "python",
365365
"pygments_lexer": "ipython3",
366-
"version": "3.8.5"
366+
"version": "3.12.11"
367367
}
368368
},
369369
"nbformat": 4,

src/MaxText/examples/sft_llama3_demo.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@
173173
"cell_type": "code",
174174
"execution_count": null,
175175
"metadata": {},
176-
"outputs": [],
177176
"source": [
178177
"if IN_COLAB:\n",
179178
" HF_TOKEN = userdata.get(\"HF_TOKEN\")\n",
@@ -345,7 +344,7 @@
345344
"provenance": []
346345
},
347346
"kernelspec": {
348-
"display_name": "base",
347+
"display_name": "Python 3",
349348
"language": "python",
350349
"name": "python3"
351350
},

src/MaxText/examples/sft_qwen3_demo.ipynb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@
111111
"**⚠️ Note:** The installation process in following cell may take a few minutes to complete. Please be patient."
112112
]
113113
},
114+
{
115+
"cell_type": "code",
116+
"execution_count": null,
117+
"metadata": {},
118+
"outputs": [],
119+
"source": [
120+
"try:\n",
121+
" import google.colab\n",
122+
" print(\"Running the notebook in Google Colab\")\n",
123+
" IN_COLAB = True\n",
124+
"except ImportError:\n",
125+
" print(\"Running the notebook on JupyterLab\")\n",
126+
" IN_COLAB = False"
127+
]
128+
},
114129
{
115130
"cell_type": "code",
116131
"execution_count": null,
@@ -586,7 +601,7 @@
586601
"provenance": []
587602
},
588603
"kernelspec": {
589-
"display_name": "Python 3 (ipykernel)",
604+
"display_name": "Python 3",
590605
"language": "python",
591606
"name": "python3"
592607
},

0 commit comments

Comments
 (0)