Skip to content

Commit

Permalink
Update notebooks to work with Googla Colab.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcCote committed Apr 28, 2023
1 parent 130e14c commit b49f035
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
5 changes: 3 additions & 2 deletions notebooks/Building a simple agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MarcCote/TextWorld/blob/msr_summit_2021/notebooks/Building%20a%20simple%20agent.ipynb)"
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/microsoft/TextWorld/blob/main/notebooks/Building%20a%20simple%20agent.ipynb)"
]
},
{
Expand All @@ -30,7 +30,8 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install textworld"
"!pip install textworld\n",
"!pip install gym==0.21"
]
},
{
Expand Down
6 changes: 5 additions & 1 deletion notebooks/Handcrafting a game.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MarcCote/TextWorld/blob/msr_summit_2021/notebooks/Handcrafting%20a%20game.ipynb)"
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/microsoft/TextWorld/blob/main/notebooks/Handcrafting%20a%20game.ipynb)"
]
},
{
Expand All @@ -31,6 +31,10 @@
"metadata": {},
"outputs": [],
"source": [
"# For Google Colab, first install\n",
"#!apt install chromium-chromedriver\n",
"#!pip install selenium==3.12.0\n",
"# then\n",
"!pip install textworld[vis]"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MarcCote/TextWorld/blob/msr_summit_2021/notebooks/Playing%20TextWorld%20generated%20games%20with%20OpenAI%20Gym.ipynb)"
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/microsoft/TextWorld/blob/main/notebooks/Playing%20TextWorld%20generated%20games%20with%20OpenAI%20Gym.ipynb)"
]
},
{
Expand Down Expand Up @@ -2350,7 +2350,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3.8.10 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -2364,7 +2364,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.10"
},
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
},
"nbformat": 4,
Expand Down
21 changes: 19 additions & 2 deletions notebooks/Playing text-based games with TextWorld.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MarcCote/TextWorld/blob/msr_summit_2021/notebooks/Playing%20text-based%20games%20with%20TextWorld.ipynb)"
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/microsoft/TextWorld/blob/main/notebooks/Playing%20text-based%20games%20with%20TextWorld.ipynb)"
]
},
{
Expand Down Expand Up @@ -63,6 +63,23 @@
"!echo \"Done.\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**[Optional]** On Google Colab, you need to download additional data beforehand."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!wget https://aka.ms/textworld/notebooks/data.zip\n",
"!unzip -nq data.zip && rm -f data.zip"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -659,7 +676,7 @@
}
],
"source": [
"textworld.play(\"./games/rewardsSparse_goalNone.z8\")"
"textworld.play(\"./games/tw-rewardsSparse_goalNone.z8\")"
]
},
{
Expand Down

0 comments on commit b49f035

Please sign in to comment.