Skip to content

Commit

Permalink
add sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez committed Dec 10, 2024
1 parent 1c84c21 commit b238b4d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nbs/src/nixtla_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@
"outputs": [],
"source": [
"#| hide\n",
"import time\n",
"from contextlib import contextmanager\n",
"from itertools import product\n",
"from time import time, sleep\n",
"\n",
"from dotenv import load_dotenv\n",
"from fastcore.test import test_eq, test_fail\n",
Expand Down Expand Up @@ -2459,9 +2459,10 @@
"model_id2 = nixtla_client.finetune(train, finetuned_model_id=model_id1)\n",
"\n",
"# list finetuned models\n",
"time.sleep(2) # it can take a bit for the models to show up\n",
"models = nixtla_client.finetuned_models()\n",
"ids = {m.id for m in models}\n",
"assert {model_id1, model_id2} <= ids, [{model_id1, model_id2}, ids]"
"assert {model_id1, model_id2} <= ids"
]
},
{
Expand Down Expand Up @@ -3014,7 +3015,7 @@
"def raise_read_timeout_error(*args, **kwargs):\n",
" sleep_seconds = 5\n",
" print(f'raising ReadTimeout error after {sleep_seconds} seconds')\n",
" sleep(sleep_seconds)\n",
" time.sleep(sleep_seconds)\n",
" raise httpx.ReadTimeout('Timed out')\n",
"\n",
"def raise_http_error(*args, **kwargs):\n",
Expand Down

0 comments on commit b238b4d

Please sign in to comment.