Skip to content

Commit b49f035

Browse files
committed
Update notebooks to work with Googla Colab.
1 parent 130e14c commit b49f035

4 files changed

+35
-8
lines changed

Diff for: notebooks/Building a simple agent.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"[![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)"
7+
"[![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)"
88
]
99
},
1010
{
@@ -30,7 +30,8 @@
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
33-
"!pip install textworld"
33+
"!pip install textworld\n",
34+
"!pip install gym==0.21"
3435
]
3536
},
3637
{

Diff for: notebooks/Handcrafting a game.ipynb

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"[![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)"
7+
"[![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)"
88
]
99
},
1010
{
@@ -31,6 +31,10 @@
3131
"metadata": {},
3232
"outputs": [],
3333
"source": [
34+
"# For Google Colab, first install\n",
35+
"#!apt install chromium-chromedriver\n",
36+
"#!pip install selenium==3.12.0\n",
37+
"# then\n",
3438
"!pip install textworld[vis]"
3539
]
3640
},

Diff for: notebooks/Playing TextWorld generated games with OpenAI Gym.ipynb

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"[![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)"
7+
"[![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)"
88
]
99
},
1010
{
@@ -2350,7 +2350,7 @@
23502350
],
23512351
"metadata": {
23522352
"kernelspec": {
2353-
"display_name": "Python 3",
2353+
"display_name": "Python 3.8.10 64-bit",
23542354
"language": "python",
23552355
"name": "python3"
23562356
},
@@ -2364,7 +2364,12 @@
23642364
"name": "python",
23652365
"nbconvert_exporter": "python",
23662366
"pygments_lexer": "ipython3",
2367-
"version": "3.7.3"
2367+
"version": "3.8.10"
2368+
},
2369+
"vscode": {
2370+
"interpreter": {
2371+
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
2372+
}
23682373
}
23692374
},
23702375
"nbformat": 4,

Diff for: notebooks/Playing text-based games with TextWorld.ipynb

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"[![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)"
7+
"[![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)"
88
]
99
},
1010
{
@@ -63,6 +63,23 @@
6363
"!echo \"Done.\""
6464
]
6565
},
66+
{
67+
"cell_type": "markdown",
68+
"metadata": {},
69+
"source": [
70+
"**[Optional]** On Google Colab, you need to download additional data beforehand."
71+
]
72+
},
73+
{
74+
"cell_type": "code",
75+
"execution_count": null,
76+
"metadata": {},
77+
"outputs": [],
78+
"source": [
79+
"!wget https://aka.ms/textworld/notebooks/data.zip\n",
80+
"!unzip -nq data.zip && rm -f data.zip"
81+
]
82+
},
6683
{
6784
"cell_type": "markdown",
6885
"metadata": {},
@@ -659,7 +676,7 @@
659676
}
660677
],
661678
"source": [
662-
"textworld.play(\"./games/rewardsSparse_goalNone.z8\")"
679+
"textworld.play(\"./games/tw-rewardsSparse_goalNone.z8\")"
663680
]
664681
},
665682
{

0 commit comments

Comments
 (0)