Skip to content

Commit d755ee6

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Completes UNB-2545 - Don't download requirements.txt if it already exists locally
1 parent 36f1ec3 commit d755ee6

File tree

15 files changed

+124
-66
lines changed

15 files changed

+124
-66
lines changed

examples/tabular-classification/documentation-tutorial/tabular-tutorial-part-1.ipynb

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,16 @@
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": 1,
24+
"execution_count": 22,
2525
"id": "56758c0a",
2626
"metadata": {},
27-
"outputs": [
28-
{
29-
"name": "stdout",
30-
"output_type": "stream",
31-
"text": [
32-
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
33-
" Dload Upload Total Spent Left Speed\n",
34-
"100 47 100 47 0 0 118 0 --:--:-- --:--:-- --:--:-- 121\n"
35-
]
36-
}
37-
],
27+
"outputs": [],
3828
"source": [
39-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/documentation-tutorial/requirements.txt\" --output \"requirements.txt\""
29+
"%%bash\n",
30+
"\n",
31+
"if [ ! -e \"requirements.txt\" ]; then\n",
32+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/documentation-tutorial/requirements.txt\" --output \"requirements.txt\"\n",
33+
"fi"
4034
]
4135
},
4236
{

examples/tabular-classification/documentation-tutorial/tabular-tutorial-part-2.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": null,
24+
"execution_count": 27,
2525
"id": "3262f874",
2626
"metadata": {},
2727
"outputs": [],
2828
"source": [
29-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/documentation-tutorial/requirements.txt\" --output \"requirements.txt\""
29+
"%%bash\n",
30+
"\n",
31+
"if [ ! -e \"requirements.txt\" ]; then\n",
32+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/documentation-tutorial/requirements.txt\" --output \"requirements.txt\"\n",
33+
"fi"
3034
]
3135
},
3236
{

examples/tabular-classification/sklearn/churn-classifier/churn-classifier-sklearn.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": null,
18+
"execution_count": 2,
1919
"id": "04b9d9a3",
2020
"metadata": {
2121
"scrolled": true
2222
},
2323
"outputs": [],
2424
"source": [
25-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\""
25+
"%%bash\n",
26+
"\n",
27+
"if [ ! -e \"requirements.txt\" ]; then\n",
28+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\"\n",
29+
"fi"
2630
]
2731
},
2832
{

examples/tabular-classification/sklearn/fetal-health/fetal-health-sklearn.ipynb

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,25 @@
1414
},
1515
{
1616
"cell_type": "code",
17-
"execution_count": null,
17+
"execution_count": 1,
1818
"metadata": {},
19-
"outputs": [],
19+
"outputs": [
20+
{
21+
"name": "stderr",
22+
"output_type": "stream",
23+
"text": [
24+
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
25+
" Dload Upload Total Spent Left Speed\n",
26+
"100 47 100 47 0 0 342 0 --:--:-- --:--:-- --:--:-- 353\n"
27+
]
28+
}
29+
],
2030
"source": [
21-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\""
31+
"%%bash\n",
32+
"\n",
33+
"if [ ! -e \"requirements.txt\" ]; then\n",
34+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\"\n",
35+
"fi"
2236
]
2337
},
2438
{

examples/tabular-classification/sklearn/fraud-detection/fraud-classifier-sklearn.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": null,
18+
"execution_count": 2,
1919
"id": "1ccfff1a",
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\""
23+
"%%bash\n",
24+
"\n",
25+
"if [ ! -e \"requirements.txt\" ]; then\n",
26+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\"\n",
27+
"fi"
2428
]
2529
},
2630
{

examples/tabular-classification/sklearn/iris-classifier/iris-tabular-sklearn.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
},
1515
{
1616
"cell_type": "code",
17-
"execution_count": null,
17+
"execution_count": 2,
1818
"metadata": {},
1919
"outputs": [],
2020
"source": [
21-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\""
21+
"%%bash\n",
22+
"\n",
23+
"if [ ! -e \"requirements.txt\" ]; then\n",
24+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/sklearn/requirements.txt\" --output \"requirements.txt\"\n",
25+
"fi"
2226
]
2327
},
2428
{

examples/tabular-classification/xgboost/xgboost.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": null,
18+
"execution_count": 4,
1919
"id": "f8ef72aa",
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/xgboost/requirements.txt\" --output \"requirements.txt\""
23+
"%%bash\n",
24+
"\n",
25+
"if [ ! -e \"requirements.txt\" ]; then\n",
26+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/tabular-classification/xgboost/requirements.txt\" --output \"requirements.txt\"\n",
27+
"fi"
2428
]
2529
},
2630
{

examples/text-classification/custom/stacked-models/fastttext-stacked.ipynb

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": null,
18+
"execution_count": 2,
1919
"id": "f980cec2",
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/text-classification/custom/stacked-models/requirements.txt\" --output \"requirements.txt\""
23+
"%%bash\n",
24+
"\n",
25+
"if [ ! -e \"requirements.txt\" ]; then\n",
26+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/text-classification/custom/stacked-models/requirements.txt\" --output \"requirements.txt\"\n",
27+
"fi"
2428
]
2529
},
2630
{
@@ -43,7 +47,7 @@
4347
},
4448
{
4549
"cell_type": "code",
46-
"execution_count": 1,
50+
"execution_count": 6,
4751
"id": "bc5fc92e",
4852
"metadata": {},
4953
"outputs": [],
@@ -71,47 +75,55 @@
7175
},
7276
{
7377
"cell_type": "code",
74-
"execution_count": 2,
78+
"execution_count": 8,
7579
"id": "c1e4747d",
7680
"metadata": {},
7781
"outputs": [
7882
{
79-
"name": "stdout",
83+
"name": "stderr",
8084
"output_type": "stream",
8185
"text": [
8286
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
8387
" Dload Upload Total Spent Left Speed\n",
84-
"100 13.3M 100 13.3M 0 0 2748k 0 0:00:04 0:00:04 --:--:-- 3391k\n"
88+
"100 13.3M 100 13.3M 0 0 1611k 0 0:00:08 0:00:08 --:--:-- 2183k\n"
8589
]
8690
}
8791
],
8892
"source": [
89-
"!curl -0 https://unbox-static-assets.s3.us-west-2.amazonaws.com/examples-datasets/text-classification/rec.txt -o rec.txt"
93+
"%%bash\n",
94+
"\n",
95+
"if [ ! -e \"rec.txt\" ]; then\n",
96+
" curl \"https://unbox-static-assets.s3.us-west-2.amazonaws.com/examples-datasets/text-classification/rec.txt\" --output \"rec.txt\"\n",
97+
"fi"
9098
]
9199
},
92100
{
93101
"cell_type": "code",
94-
"execution_count": 3,
102+
"execution_count": 19,
95103
"id": "a54e7139",
96104
"metadata": {},
97105
"outputs": [
98106
{
99-
"name": "stdout",
107+
"name": "stderr",
100108
"output_type": "stream",
101109
"text": [
102110
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
103111
" Dload Upload Total Spent Left Speed\n",
104-
"100 1952k 100 1952k 0 0 700k 0 0:00:02 0:00:02 --:--:-- 702k\n"
112+
"100 1952k 100 1952k 0 0 627k 0 0:00:03 0:00:03 --:--:-- 628k\n"
105113
]
106114
}
107115
],
108116
"source": [
109-
"!curl -0 https://unbox-static-assets.s3.us-west-2.amazonaws.com/examples-datasets/text-classification/rec_type.txt -o rec_type.txt"
117+
"%%bash\n",
118+
"\n",
119+
"if [ ! -e \"rec_type.txt\" ]; then\n",
120+
" curl -0 \"https://unbox-static-assets.s3.us-west-2.amazonaws.com/examples-datasets/text-classification/rec_type.txt\" -o \"rec_type.txt\" --output \"rec_type.txt\"\n",
121+
"fi"
110122
]
111123
},
112124
{
113125
"cell_type": "code",
114-
"execution_count": 4,
126+
"execution_count": 16,
115127
"id": "03b71c88",
116128
"metadata": {},
117129
"outputs": [
@@ -122,7 +134,7 @@
122134
"Read 2M words\n",
123135
"Number of words: 211125\n",
124136
"Number of labels: 2\n",
125-
"Progress: 100.0% words/sec/thread: 6781308 lr: 0.000000 avg.loss: 0.394923 ETA: 0h 0m 0s\n"
137+
"Progress: 100.0% words/sec/thread: 7157244 lr: 0.000000 avg.loss: 0.396901 ETA: 0h 0m 0s\n"
126138
]
127139
}
128140
],
@@ -132,7 +144,7 @@
132144
},
133145
{
134146
"cell_type": "code",
135-
"execution_count": 5,
147+
"execution_count": 20,
136148
"id": "fa17bdaa",
137149
"metadata": {
138150
"scrolled": true
@@ -145,7 +157,7 @@
145157
"Read 0M words\n",
146158
"Number of words: 49236\n",
147159
"Number of labels: 4\n",
148-
"Progress: 100.0% words/sec/thread: 6647719 lr: 0.000000 avg.loss: 1.107581 ETA: 0h 0m 0s\n"
160+
"Progress: 100.0% words/sec/thread: 8008669 lr: 0.000000 avg.loss: 1.093604 ETA: 0h 0m 0s\n"
149161
]
150162
}
151163
],

examples/text-classification/documentation-tutorial/nlp_tutorial.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": null,
23+
"execution_count": 1,
2424
"metadata": {},
2525
"outputs": [],
2626
"source": [
27-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/text-classification/documentation-tutorial/requirements.txt\" --output \"requirements.txt\""
27+
"%%bash\n",
28+
"\n",
29+
"if [ ! -e \"requirements.txt\" ]; then\n",
30+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/text-classification/documentation-tutorial/requirements.txt\" --output \"requirements.txt\"\n",
31+
"fi"
2832
]
2933
},
3034
{

examples/text-classification/fasttext/fasttext.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": null,
18+
"execution_count": 1,
1919
"id": "c9647c25",
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"!curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/text-classification/fasttext/requirements.txt\" --output \"requirements.txt\""
23+
"%%bash\n",
24+
"\n",
25+
"if [ ! -e \"requirements.txt\" ]; then\n",
26+
" curl \"https://raw.githubusercontent.com/unboxai/examples-gallery/main/text-classification/fasttext/requirements.txt\" --output \"requirements.txt\"\n",
27+
"fi"
2428
]
2529
},
2630
{

0 commit comments

Comments
 (0)