Skip to content

Commit c1c3ec0

Browse files
authored
Merge pull request #944 from NeuromatchAcademy/release-v1.0.0
Release v1.0.0
2 parents e620933 + d0094d4 commit c1c3ec0

File tree

4 files changed

+131
-31
lines changed

4 files changed

+131
-31
lines changed

.github/workflows/notebook-pr.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,14 @@ jobs:
8686
python ci/verify_exercises.py $nbs --c "$COMMIT_MESSAGE"
8787
python ci/make_pr_comment.py $nbs --branch $branch --o comment.txt
8888
89-
- name: Add PR comment
90-
if: "!contains(env.COMMIT_MESSAGE, 'skip ci')"
91-
uses: machine-learning-apps/[email protected]
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
with:
95-
path: comment.txt
89+
# This package is outdated and no longer maintained
90+
# - name: Add PR comment
91+
# if: "!contains(env.COMMIT_MESSAGE, 'skip ci')"
92+
# uses: machine-learning-apps/[email protected]
93+
# env:
94+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
# with:
96+
# path: comment.txt
9697

9798
- name: Update READMEs
9899
if: "!contains(env.COMMIT_MESSAGE, 'skip ci')"

tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/W3D1_Tutorial2.ipynb

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"id": "view-in-github"
99
},
1010
"source": [
11-
"<a href=\"https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> &nbsp; <a href=\"https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/NeuromatchAcademy/course-content-dl/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" alt=\"Open in Kaggle\"/></a>"
11+
"<a href=\"https://colab.research.google.com/github/wangshaonan/course-content-dl/blob/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> &nbsp; <a href=\"https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/NeuromatchAcademy/course-content-dl/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" alt=\"Open in Kaggle\"/></a>"
1212
]
1313
},
1414
{
@@ -29,7 +29,7 @@
2929
"\n",
3030
"__Content editors:__ Konrad Kording, Shaonan Wang\n",
3131
"\n",
32-
"__Production editors:__ Konrad Kording, Spiros Chavlis"
32+
"__Production editors:__ Konrad Kording, Spiros Chavlis, Konstantine Tsafatinos"
3333
]
3434
},
3535
{
@@ -1656,11 +1656,44 @@
16561656
"source": [
16571657
"## Play around with LLMs\n",
16581658
"\n",
1659-
"Try the following questions with [ChatGPT](https://openai.com/blog/chatgpt) (GPT3.5 without access to the web) and with GPTBing in creative mode (GPT4 with access to the web). Note that the latter requires installing Microsoft Edge.\n",
1659+
"1. Try using LLMs' API to do tasks, such as utilizing the GPT-2 API to extend text from a provided context. To achieve this, ensure you have a HuggingFace account and secure an API token.\n",
16601660
"\n",
1661-
"Pick someone you know who is likely to have a web presence but is not super famous (not Musk or Trump). Ask GPT for a two-paragraph biography. How good is it?\n",
1661+
"\n"
1662+
]
1663+
},
1664+
{
1665+
"cell_type": "code",
1666+
"execution_count": null,
1667+
"metadata": {
1668+
"execution": {}
1669+
},
1670+
"outputs": [],
1671+
"source": [
1672+
"import requests\n",
1673+
"\n",
1674+
"def query(payload, model_id, api_token):\n",
1675+
" headers = {\"Authorization\": f\"Bearer {api_token}\"}\n",
1676+
" API_URL = f\"https://api-inference.huggingface.co/models/{model_id}\"\n",
1677+
" response = requests.post(API_URL, headers=headers, json=payload)\n",
1678+
" return response.json()\n",
16621679
"\n",
1663-
"Ask it something like “What is the US, UK, Germany, China, and Japan's per capita income over the past ten years? Plot the data in a single figure” (depending on when and where you run this, you will need to paste the resulting Python code into a colab notebook). Try asking it questions about the data or the definition of “per capita income” used. How good is it?"
1680+
"model_id = \"gpt2\"\n",
1681+
"api_token = \"hf_****\" # get yours at hf.co/settings/tokens\n",
1682+
"data = query(\"The goal of life is\", model_id, api_token)\n",
1683+
"print(data)"
1684+
]
1685+
},
1686+
{
1687+
"cell_type": "markdown",
1688+
"metadata": {
1689+
"execution": {}
1690+
},
1691+
"source": [
1692+
"2. Try the following questions with [ChatGPT](https://openai.com/blog/chatgpt) (GPT3.5 without access to the web) and with GPTBing in creative mode (GPT4 with access to the web). Note that the latter requires installing Microsoft Edge.\n",
1693+
"\n",
1694+
" Pick someone you know who is likely to have a web presence but is not super famous (not Musk or Trump). Ask GPT for a two-paragraph biography. How good is it?\n",
1695+
"\n",
1696+
" Ask it something like “What is the US, UK, Germany, China, and Japan's per capita income over the past ten years? Plot the data in a single figure” (depending on when and where you run this, you will need to paste the resulting Python code into a colab notebook). Try asking it questions about the data or the definition of “per capita income” used. How good is it?"
16641697
]
16651698
},
16661699
{
@@ -1801,7 +1834,7 @@
18011834
"name": "python3"
18021835
},
18031836
"kernelspec": {
1804-
"display_name": "Python 3",
1837+
"display_name": "Python 3 (ipykernel)",
18051838
"language": "python",
18061839
"name": "python3"
18071840
},
@@ -1815,10 +1848,10 @@
18151848
"name": "python",
18161849
"nbconvert_exporter": "python",
18171850
"pygments_lexer": "ipython3",
1818-
"version": "3.7.3"
1851+
"version": "3.9.19"
18191852
},
18201853
"toc-autonumbering": true
18211854
},
18221855
"nbformat": 4,
1823-
"nbformat_minor": 0
1856+
"nbformat_minor": 4
18241857
}

tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/instructor/W3D1_Tutorial2.ipynb

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"id": "view-in-github"
99
},
1010
"source": [
11-
"<a href=\"https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/instructor/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> &nbsp; <a href=\"https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/NeuromatchAcademy/course-content-dl/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/instructor/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" alt=\"Open in Kaggle\"/></a>"
11+
"<a href=\"https://colab.research.google.com/github/wangshaonan/course-content-dl/blob/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/instructor/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> &nbsp; <a href=\"https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/NeuromatchAcademy/course-content-dl/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/instructor/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" alt=\"Open in Kaggle\"/></a>"
1212
]
1313
},
1414
{
@@ -29,7 +29,7 @@
2929
"\n",
3030
"__Content editors:__ Konrad Kording, Shaonan Wang\n",
3131
"\n",
32-
"__Production editors:__ Konrad Kording, Spiros Chavlis"
32+
"__Production editors:__ Konrad Kording, Spiros Chavlis, Konstantine Tsafatinos"
3333
]
3434
},
3535
{
@@ -1658,11 +1658,44 @@
16581658
"source": [
16591659
"## Play around with LLMs\n",
16601660
"\n",
1661-
"Try the following questions with [ChatGPT](https://openai.com/blog/chatgpt) (GPT3.5 without access to the web) and with GPTBing in creative mode (GPT4 with access to the web). Note that the latter requires installing Microsoft Edge.\n",
1661+
"1. Try using LLMs' API to do tasks, such as utilizing the GPT-2 API to extend text from a provided context. To achieve this, ensure you have a HuggingFace account and secure an API token.\n",
16621662
"\n",
1663-
"Pick someone you know who is likely to have a web presence but is not super famous (not Musk or Trump). Ask GPT for a two-paragraph biography. How good is it?\n",
1663+
"\n"
1664+
]
1665+
},
1666+
{
1667+
"cell_type": "code",
1668+
"execution_count": null,
1669+
"metadata": {
1670+
"execution": {}
1671+
},
1672+
"outputs": [],
1673+
"source": [
1674+
"import requests\n",
1675+
"\n",
1676+
"def query(payload, model_id, api_token):\n",
1677+
" headers = {\"Authorization\": f\"Bearer {api_token}\"}\n",
1678+
" API_URL = f\"https://api-inference.huggingface.co/models/{model_id}\"\n",
1679+
" response = requests.post(API_URL, headers=headers, json=payload)\n",
1680+
" return response.json()\n",
16641681
"\n",
1665-
"Ask it something like “What is the US, UK, Germany, China, and Japan's per capita income over the past ten years? Plot the data in a single figure” (depending on when and where you run this, you will need to paste the resulting Python code into a colab notebook). Try asking it questions about the data or the definition of “per capita income” used. How good is it?"
1682+
"model_id = \"gpt2\"\n",
1683+
"api_token = \"hf_****\" # get yours at hf.co/settings/tokens\n",
1684+
"data = query(\"The goal of life is\", model_id, api_token)\n",
1685+
"print(data)"
1686+
]
1687+
},
1688+
{
1689+
"cell_type": "markdown",
1690+
"metadata": {
1691+
"execution": {}
1692+
},
1693+
"source": [
1694+
"2. Try the following questions with [ChatGPT](https://openai.com/blog/chatgpt) (GPT3.5 without access to the web) and with GPTBing in creative mode (GPT4 with access to the web). Note that the latter requires installing Microsoft Edge.\n",
1695+
"\n",
1696+
" Pick someone you know who is likely to have a web presence but is not super famous (not Musk or Trump). Ask GPT for a two-paragraph biography. How good is it?\n",
1697+
"\n",
1698+
" Ask it something like “What is the US, UK, Germany, China, and Japan's per capita income over the past ten years? Plot the data in a single figure” (depending on when and where you run this, you will need to paste the resulting Python code into a colab notebook). Try asking it questions about the data or the definition of “per capita income” used. How good is it?"
16661699
]
16671700
},
16681701
{
@@ -1803,7 +1836,7 @@
18031836
"name": "python3"
18041837
},
18051838
"kernelspec": {
1806-
"display_name": "Python 3",
1839+
"display_name": "Python 3 (ipykernel)",
18071840
"language": "python",
18081841
"name": "python3"
18091842
},
@@ -1817,10 +1850,10 @@
18171850
"name": "python",
18181851
"nbconvert_exporter": "python",
18191852
"pygments_lexer": "ipython3",
1820-
"version": "3.7.3"
1853+
"version": "3.9.19"
18211854
},
18221855
"toc-autonumbering": true
18231856
},
18241857
"nbformat": 4,
1825-
"nbformat_minor": 0
1858+
"nbformat_minor": 4
18261859
}

tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/student/W3D1_Tutorial2.ipynb

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"id": "view-in-github"
99
},
1010
"source": [
11-
"<a href=\"https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/student/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> &nbsp; <a href=\"https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/NeuromatchAcademy/course-content-dl/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/student/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" alt=\"Open in Kaggle\"/></a>"
11+
"<a href=\"https://colab.research.google.com/github/wangshaonan/course-content-dl/blob/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/student/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> &nbsp; <a href=\"https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/NeuromatchAcademy/course-content-dl/main/tutorials/W3D1_TimeSeriesAndNaturalLanguageProcessing/student/W3D1_Tutorial2.ipynb\" target=\"_parent\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" alt=\"Open in Kaggle\"/></a>"
1212
]
1313
},
1414
{
@@ -29,7 +29,7 @@
2929
"\n",
3030
"__Content editors:__ Konrad Kording, Shaonan Wang\n",
3131
"\n",
32-
"__Production editors:__ Konrad Kording, Spiros Chavlis"
32+
"__Production editors:__ Konrad Kording, Spiros Chavlis, Konstantine Tsafatinos"
3333
]
3434
},
3535
{
@@ -1564,11 +1564,44 @@
15641564
"source": [
15651565
"## Play around with LLMs\n",
15661566
"\n",
1567-
"Try the following questions with [ChatGPT](https://openai.com/blog/chatgpt) (GPT3.5 without access to the web) and with GPTBing in creative mode (GPT4 with access to the web). Note that the latter requires installing Microsoft Edge.\n",
1567+
"1. Try using LLMs' API to do tasks, such as utilizing the GPT-2 API to extend text from a provided context. To achieve this, ensure you have a HuggingFace account and secure an API token.\n",
15681568
"\n",
1569-
"Pick someone you know who is likely to have a web presence but is not super famous (not Musk or Trump). Ask GPT for a two-paragraph biography. How good is it?\n",
1569+
"\n"
1570+
]
1571+
},
1572+
{
1573+
"cell_type": "code",
1574+
"execution_count": null,
1575+
"metadata": {
1576+
"execution": {}
1577+
},
1578+
"outputs": [],
1579+
"source": [
1580+
"import requests\n",
1581+
"\n",
1582+
"def query(payload, model_id, api_token):\n",
1583+
" headers = {\"Authorization\": f\"Bearer {api_token}\"}\n",
1584+
" API_URL = f\"https://api-inference.huggingface.co/models/{model_id}\"\n",
1585+
" response = requests.post(API_URL, headers=headers, json=payload)\n",
1586+
" return response.json()\n",
15701587
"\n",
1571-
"Ask it something like “What is the US, UK, Germany, China, and Japan's per capita income over the past ten years? Plot the data in a single figure” (depending on when and where you run this, you will need to paste the resulting Python code into a colab notebook). Try asking it questions about the data or the definition of “per capita income” used. How good is it?"
1588+
"model_id = \"gpt2\"\n",
1589+
"api_token = \"hf_****\" # get yours at hf.co/settings/tokens\n",
1590+
"data = query(\"The goal of life is\", model_id, api_token)\n",
1591+
"print(data)"
1592+
]
1593+
},
1594+
{
1595+
"cell_type": "markdown",
1596+
"metadata": {
1597+
"execution": {}
1598+
},
1599+
"source": [
1600+
"2. Try the following questions with [ChatGPT](https://openai.com/blog/chatgpt) (GPT3.5 without access to the web) and with GPTBing in creative mode (GPT4 with access to the web). Note that the latter requires installing Microsoft Edge.\n",
1601+
"\n",
1602+
" Pick someone you know who is likely to have a web presence but is not super famous (not Musk or Trump). Ask GPT for a two-paragraph biography. How good is it?\n",
1603+
"\n",
1604+
" Ask it something like “What is the US, UK, Germany, China, and Japan's per capita income over the past ten years? Plot the data in a single figure” (depending on when and where you run this, you will need to paste the resulting Python code into a colab notebook). Try asking it questions about the data or the definition of “per capita income” used. How good is it?"
15721605
]
15731606
},
15741607
{
@@ -1709,7 +1742,7 @@
17091742
"name": "python3"
17101743
},
17111744
"kernelspec": {
1712-
"display_name": "Python 3",
1745+
"display_name": "Python 3 (ipykernel)",
17131746
"language": "python",
17141747
"name": "python3"
17151748
},
@@ -1723,10 +1756,10 @@
17231756
"name": "python",
17241757
"nbconvert_exporter": "python",
17251758
"pygments_lexer": "ipython3",
1726-
"version": "3.7.3"
1759+
"version": "3.9.19"
17271760
},
17281761
"toc-autonumbering": true
17291762
},
17301763
"nbformat": 4,
1731-
"nbformat_minor": 0
1764+
"nbformat_minor": 4
17321765
}

0 commit comments

Comments
 (0)