Skip to content

Commit 4e14357

Browse files
committed
speedup influence sentiment analysis notebook in CI
1 parent 7e0d1ba commit 4e14357

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

notebooks/influence_sentiment_analysis.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
}
8585
],
8686
"source": [
87+
"import os\n",
8788
"from copy import deepcopy\n",
8889
"from typing import Sequence\n",
8990
"\n",
@@ -130,7 +131,8 @@
130131
"source": [
131132
"seed = 42\n",
132133
"torch.manual_seed(seed)\n",
133-
"torch.cuda.manual_seed(seed)"
134+
"torch.cuda.manual_seed(seed)\n",
135+
"is_CI = os.environ.get(\"CI\")"
134136
]
135137
},
136138
{
@@ -577,8 +579,8 @@
577579
}
578580
],
579581
"source": [
580-
"NUM_TRAIN_EXAMPLES = 100\n",
581-
"NUM_TEST_EXAMPLES = 100\n",
582+
"NUM_TRAIN_EXAMPLES = 100 if not is_CI else 7\n",
583+
"NUM_TEST_EXAMPLES = 100 if not is_CI else 5\n",
582584
"\n",
583585
"small_train_dataset = (\n",
584586
" imdb[\"train\"]\n",

0 commit comments

Comments
 (0)