Skip to content

Commit

Permalink
Edit try_cot and add gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
astonzhang committed Oct 14, 2022
1 parent d34b2b7 commit d50f0a0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.ipynb_checkpoints/
__pycache__/
52 changes: 28 additions & 24 deletions try_cot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2022-10-14T22:40:48.009758Z",
"start_time": "2022-10-14T22:40:44.952090Z"
},
"pycharm": {
"name": "#%%\n"
}
Expand Down Expand Up @@ -34,18 +37,22 @@
"sys.argv=['']\n",
"del sys\n",
"from api import cot\n",
"\n",
"question = \"There were 10 friends playing a video game online when 7 players quit. If each player left had 8 lives, how many lives did they have total?\"\n",
"# for involving GPT-3, please add your openai-api key in utils.py (#Line 59)\n",
"# method = [\"zero_shot\", \"zero_shot_cot\", \"manual_cot\", \"auto_cot\"]\n",
"print(\"Example: Zero-Shot\")\n",
"# To use GPT-3, please add your openai-api key in utils.py (#Line 59)\n",
"# method = [\"zero_shot\", \"zero_shot_cot\", \"manual_cot\", \"auto_cot\"]\n",
"cot(method=\"zero_shot\", question=question)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 2,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2022-10-14T22:40:53.793176Z",
"start_time": "2022-10-14T22:40:48.012903Z"
},
"pycharm": {
"name": "#%%\n"
}
Expand All @@ -56,7 +63,6 @@
"output_type": "stream",
"text": [
"Example: Zero-Shot-CoT\n",
"2022/10/12 12:48:47\n",
"*****************************\n",
"Test Question:\n",
"There were 10 friends playing a video game online when 7 players quit. If each player left had 8 lives, how many lives did they have total?\n",
Expand All @@ -74,17 +80,18 @@
"source": [
"from api import cot\n",
"question = \"There were 10 friends playing a video game online when 7 players quit. If each player left had 8 lives, how many lives did they have total?\"\n",
"# for involving GPT-3, please add your openai-api key in utils.py (#Line 55)\n",
"# method = [\"zero_shot\", \"zero_shot_cot\", \"manual_cot\", \"auto_cot\"]\n",
"print(\"Example: Zero-Shot-CoT\")\n",
"cot(method=\"zero_shot_cot\", question=question)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 3,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2022-10-14T22:40:56.393930Z",
"start_time": "2022-10-14T22:40:53.795253Z"
},
"pycharm": {
"name": "#%%\n"
}
Expand All @@ -95,7 +102,6 @@
"output_type": "stream",
"text": [
"Example: Manual-CoT\n",
"2022/10/12 12:39:57\n",
"*****************************\n",
"Test Question:\n",
"In a video game, each enemy defeated gives you 7 points. If a level has 11 enemies total and you destroy all but 8 of them, how many points would you earn?\n",
Expand Down Expand Up @@ -129,17 +135,18 @@
"source": [
"from api import cot\n",
"question = \"In a video game, each enemy defeated gives you 7 points. If a level has 11 enemies total and you destroy all but 8 of them, how many points would you earn?\"\n",
"# for involving GPT-3, please add your openai-api key in utils.py (#Line 55)\n",
"# method = [\"zero_shot\", \"zero_shot_cot\", \"manual_cot\", \"auto_cot\"]\n",
"print(\"Example: Manual-CoT\")\n",
"cot(method=\"manual_cot\", question=question)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 4,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2022-10-14T22:41:00.702149Z",
"start_time": "2022-10-14T22:40:56.396849Z"
},
"pycharm": {
"name": "#%%\n"
}
Expand All @@ -150,7 +157,6 @@
"output_type": "stream",
"text": [
"Example: Auto-CoT\n",
"2022/10/12 12:40:22\n",
"*****************************\n",
"Test Question:\n",
"In a video game, each enemy defeated gives you 7 points. If a level has 11 enemies total and you destroy all but 8 of them, how many points would you earn?\n",
Expand Down Expand Up @@ -184,32 +190,30 @@
"source": [
"from api import cot\n",
"question = \"In a video game, each enemy defeated gives you 7 points. If a level has 11 enemies total and you destroy all but 8 of them, how many points would you earn?\"\n",
"# for involving GPT-3, please add your openai-api key in utils.py (#Line 55)\n",
"# method = [\"zero_shot\", \"zero_shot_cot\", \"manual_cot\", \"auto_cot\"]\n",
"print(\"Example: Auto-CoT\")\n",
"cot(method=\"auto_cot\", question=question)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}

0 comments on commit d50f0a0

Please sign in to comment.