File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9393 " os.mkdir(output_folder)"
9494 ]
9595 },
96+ {
97+ "cell_type": "markdown",
98+ "metadata": {
99+ "id": "msn8VDKxwWKQ"
100+ },
101+ "source": [
102+ "Setup a local Dask cluster. This distributes the computation across multiple workers on your computer."
103+ ]
104+ },
105+ {
106+ "cell_type": "code",
107+ "execution_count": null,
108+ "metadata": {
109+ "id": "BaKZVxQ5IRJa"
110+ },
111+ "outputs": [],
112+ "source": [
113+ "from dask.distributed import Client\n",
114+ "client = Client() # set up local cluster on the machine\n",
115+ "client"
116+ ]
117+ },
118+ {
119+ "cell_type": "markdown",
120+ "metadata": {
121+ "id": "E5pU7R7XIb-3"
122+ },
123+ "source": [
124+ "If you are running this notebook in Colab, you will need to create and use a proxy URL to see the dashboard running on the local server.\n",
125+ "\n"
126+ ]
127+ },
128+ {
129+ "cell_type": "code",
130+ "execution_count": null,
131+ "metadata": {
132+ "id": "25cU4Gl0Icy4"
133+ },
134+ "outputs": [],
135+ "source": [
136+ "if 'google.colab' in str(get_ipython()):\n",
137+ " from google.colab import output\n",
138+ " port_to_expose = 8787 # This is the default port for Dask dashboard\n",
139+ " print(output.eval_js(f'google.colab.kernel.proxyPort({port_to_expose})'))"
140+ ]
141+ },
96142 {
97143 "cell_type": "code",
98144 "execution_count": null,
You can’t perform that action at this time.
0 commit comments