Skip to content

Commit

Permalink
handle forks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez committed Jul 29, 2024
1 parent 4df35c7 commit c897fd4
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions nbs/docs/getting-started/quick_start_distributed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
"source": [
"import platform\n",
"import sys\n",
"import tempfile\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import git\n",
"import numpy as np\n",
"import pandas as pd\n",
"from botocore.exceptions import NoCredentialsError\n",
"from sklearn.base import BaseEstimator\n",
"\n",
"from mlforecast.distributed import DistributedMLForecast\n",
Expand Down Expand Up @@ -559,7 +561,12 @@
"source": [
"save_dir = build_unique_name('dask')\n",
"save_path = f's3://nixtla-tmp/mlf/{save_dir}'\n",
"fcst.save(save_path)"
"tmpdir = tempfile.TemporaryDirectory()\n",
"try:\n",
" fcst.save(save_path)\n",
"except NoCredentialsError:\n",
" save_path = f'{tmpdir.name}/{save_dir}'\n",
" fcst.save(save_path)"
]
},
{
Expand Down Expand Up @@ -1241,7 +1248,11 @@
"source": [
"save_dir = build_unique_name('spark')\n",
"save_path = f's3://nixtla-tmp/mlf/{save_dir}'\n",
"fcst.save(save_path)"
"try:\n",
" fcst.save(save_path)\n",
"except NoCredentialsError:\n",
" save_path = f'{tmpdir.name}/{save_dir}'\n",
" fcst.save(save_path)"
]
},
{
Expand Down Expand Up @@ -1793,7 +1804,11 @@
"source": [
"save_dir = build_unique_name('ray')\n",
"save_path = f's3://nixtla-tmp/mlf/{save_dir}'\n",
"fcst.save(save_path)"
"try:\n",
" fcst.save(save_path)\n",
"except NoCredentialsError:\n",
" save_path = f'{tmpdir.name}/{save_dir}'\n",
" fcst.save(save_path)"
]
},
{
Expand Down

0 comments on commit c897fd4

Please sign in to comment.