Skip to content

Commit

Permalink
ckeaned notebook cells
Browse files Browse the repository at this point in the history
  • Loading branch information
corradocavalli committed Nov 15, 2023
1 parent c1b6ce0 commit 8f41fa8
Showing 1 changed file with 10 additions and 226 deletions.
236 changes: 10 additions & 226 deletions 04-prompt-engineering-fundamentals/1-introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,161 +26,9 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[198, 41, 20089, 374, 279, 18172, 11841, 505, 279, 8219, 323, 279, 7928, 304, 279, 25450, 744, 13, 1102, 374, 264, 6962, 14880, 449, 264, 3148, 832, 7716, 52949, 339, 430, 315, 279, 8219, 11, 719, 1403, 9976, 7561, 34902, 3115, 430, 315, 682, 279, 1023, 33975, 304, 279, 25450, 744, 11093, 13, 50789, 374, 832, 315, 279, 72021, 6302, 9621, 311, 279, 19557, 8071, 304, 279, 3814, 13180, 11, 323, 706, 1027, 3967, 311, 14154, 86569, 2533, 1603, 12715, 3925, 13, 1102, 374, 7086, 1306, 279, 13041, 10087, 50789, 8032, 777, 60, 3277, 19894, 505, 9420, 11, 50789, 649, 387, 10107, 3403, 369, 1202, 27000, 3177, 311, 6445, 9621, 35612, 17706, 508, 60, 323, 374, 389, 5578, 279, 4948, 1481, 1315, 478, 5933, 1665, 304, 279, 3814, 13180, 1306, 279, 17781, 323, 50076, 627]\n"
]
},
{
"data": {
"text/plain": [
"[b'\\n',\n",
" b'J',\n",
" b'upiter',\n",
" b' is',\n",
" b' the',\n",
" b' fifth',\n",
" b' planet',\n",
" b' from',\n",
" b' the',\n",
" b' Sun',\n",
" b' and',\n",
" b' the',\n",
" b' largest',\n",
" b' in',\n",
" b' the',\n",
" b' Solar',\n",
" b' System',\n",
" b'.',\n",
" b' It',\n",
" b' is',\n",
" b' a',\n",
" b' gas',\n",
" b' giant',\n",
" b' with',\n",
" b' a',\n",
" b' mass',\n",
" b' one',\n",
" b'-th',\n",
" b'ousand',\n",
" b'th',\n",
" b' that',\n",
" b' of',\n",
" b' the',\n",
" b' Sun',\n",
" b',',\n",
" b' but',\n",
" b' two',\n",
" b'-and',\n",
" b'-a',\n",
" b'-half',\n",
" b' times',\n",
" b' that',\n",
" b' of',\n",
" b' all',\n",
" b' the',\n",
" b' other',\n",
" b' planets',\n",
" b' in',\n",
" b' the',\n",
" b' Solar',\n",
" b' System',\n",
" b' combined',\n",
" b'.',\n",
" b' Jupiter',\n",
" b' is',\n",
" b' one',\n",
" b' of',\n",
" b' the',\n",
" b' brightest',\n",
" b' objects',\n",
" b' visible',\n",
" b' to',\n",
" b' the',\n",
" b' naked',\n",
" b' eye',\n",
" b' in',\n",
" b' the',\n",
" b' night',\n",
" b' sky',\n",
" b',',\n",
" b' and',\n",
" b' has',\n",
" b' been',\n",
" b' known',\n",
" b' to',\n",
" b' ancient',\n",
" b' civilizations',\n",
" b' since',\n",
" b' before',\n",
" b' recorded',\n",
" b' history',\n",
" b'.',\n",
" b' It',\n",
" b' is',\n",
" b' named',\n",
" b' after',\n",
" b' the',\n",
" b' Roman',\n",
" b' god',\n",
" b' Jupiter',\n",
" b'.[',\n",
" b'19',\n",
" b']',\n",
" b' When',\n",
" b' viewed',\n",
" b' from',\n",
" b' Earth',\n",
" b',',\n",
" b' Jupiter',\n",
" b' can',\n",
" b' be',\n",
" b' bright',\n",
" b' enough',\n",
" b' for',\n",
" b' its',\n",
" b' reflected',\n",
" b' light',\n",
" b' to',\n",
" b' cast',\n",
" b' visible',\n",
" b' shadows',\n",
" b',[',\n",
" b'20',\n",
" b']',\n",
" b' and',\n",
" b' is',\n",
" b' on',\n",
" b' average',\n",
" b' the',\n",
" b' third',\n",
" b'-b',\n",
" b'right',\n",
" b'est',\n",
" b' natural',\n",
" b' object',\n",
" b' in',\n",
" b' the',\n",
" b' night',\n",
" b' sky',\n",
" b' after',\n",
" b' the',\n",
" b' Moon',\n",
" b' and',\n",
" b' Venus',\n",
" b'.\\n']"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# EXERCISE:\n",
"# 1. Run the exercise as is first\n",
Expand Down Expand Up @@ -224,17 +72,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"By the dawn's early light,\n"
]
}
],
"outputs": [],
"source": [
"# The OpenAI SDK was updated on Nov 8, 2023 with new guidance for migration\n",
"# See: https://github.com/openai/openai-python/discussions/742\n",
Expand Down Expand Up @@ -290,49 +130,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Title: The Martian War of 2076\n",
"\n",
"Grade Level: High School\n",
"\n",
"Objective: Students will be able to understand the causes, events, and consequences of the Martian War of 2076.\n",
"\n",
"Materials:\n",
"- Textbook or online resources on the Martian War of 2076\n",
"- Maps of Mars and Earth\n",
"- Images and videos of Martian colonies and military equipment\n",
"- Writing materials\n",
"\n",
"Procedure:\n",
"\n",
"Introduction (10 minutes)\n",
"- Begin by asking students if they have heard of the Martian War of 2076 and what they know about it.\n",
"- Explain that the Martian War of 2076 was a conflict between Earth and Mars that lasted for several years and had significant consequences for both planets.\n",
"\n",
"Causes of the War (20 minutes)\n",
"- Provide students with background information on the causes of the Martian War of 2076, including the political, economic, and environmental factors that led to the conflict.\n",
"- Ask students to discuss in small groups the causes of the war and how they might have been prevented.\n",
"\n",
"Events of the War (30 minutes)\n",
"- Using maps and images, explain the major events of the Martian War of 2076, including the battles, strategies, and technologies used by both sides.\n",
"- Ask students to create a timeline of the war and identify the key turning points.\n",
"\n",
"Consequences of the War (20 minutes)\n",
"- Discuss the consequences of the Martian War of 2076, including the impact on the Martian colonies, the Earth's economy and environment, and the political relationships between the two planets.\n",
"- Ask students to write a short essay on the consequences of the war and how they might have been avoided.\n",
"\n",
"Conclusion (10 minutes)\n",
"- Summarize the key points of the lesson and ask students to reflect on what they have learned.\n",
"- Encourage students to think about the lessons that can be learned from the Martian War of 2076 and how they might apply to current global issues.\n"
]
}
],
"outputs": [],
"source": [
"\n",
"## Set the text for simple prompt or primary content\n",
Expand Down Expand Up @@ -363,17 +163,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Jupiter is a really big planet that is fifth from the Sun. It is much bigger than all the other planets combined! People have known about Jupiter for a very long time because it is very bright in the night sky. It is named after a Roman god. When we look at Jupiter from Earth, it can be so bright that it makes shadows. It is usually the third-brightest thing we can see at night after the Moon and Venus.\n"
]
}
],
"outputs": [],
"source": [
"# Test Example\n",
"# https://platform.openai.com/playground/p/default-summarize\n",
Expand Down Expand Up @@ -418,17 +210,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Why don't you take a wild guess? It was played in the only place that could hold such a prestigious event in the middle of a global pandemic... a neutral site: Globe Life Field in Arlington, Texas.\n"
]
}
],
"outputs": [],
"source": [
"response = client.chat.completions.create(\n",
" model=deployment,\n",
Expand Down

0 comments on commit 8f41fa8

Please sign in to comment.