files_cells/notebooks/en/downloading_en.ipynb
CHANGED
@@ -371,9 +371,10 @@
|
|
371 |
" model_name = data['files'][0]['name']\n",
|
372 |
"\n",
|
373 |
" # Finding a safe image: less than level 4 | Kaggle\n",
|
374 |
-
"
|
375 |
-
"
|
376 |
-
"
|
|
|
377 |
" image_url = data['images'][0]['url']\n",
|
378 |
"\n",
|
379 |
" return model_type, model_name, image_url\n",
|
|
|
371 |
" model_name = data['files'][0]['name']\n",
|
372 |
"\n",
|
373 |
" # Finding a safe image: less than level 4 | Kaggle\n",
|
374 |
+
" image_url = ''\n",
|
375 |
+
" if env == 'Kaggle' and data['images']:\n",
|
376 |
+
" image_url = next((img['url'] for img in data['images'] if img['nsfwLevel'] < 4), None)\n",
|
377 |
+
" elif data['images']:\n",
|
378 |
" image_url = data['images'][0]['url']\n",
|
379 |
"\n",
|
380 |
" return model_type, model_name, image_url\n",
|
files_cells/notebooks/ru/downloading_ru.ipynb
CHANGED
@@ -371,9 +371,10 @@
|
|
371 |
" model_name = data['files'][0]['name']\n",
|
372 |
"\n",
|
373 |
" # Finding a safe image: less than level 4 | Kaggle\n",
|
374 |
-
"
|
375 |
-
"
|
376 |
-
"
|
|
|
377 |
" image_url = data['images'][0]['url']\n",
|
378 |
"\n",
|
379 |
" return model_type, model_name, image_url\n",
|
|
|
371 |
" model_name = data['files'][0]['name']\n",
|
372 |
"\n",
|
373 |
" # Finding a safe image: less than level 4 | Kaggle\n",
|
374 |
+
" image_url = ''\n",
|
375 |
+
" if env == 'Kaggle' and data['images']:\n",
|
376 |
+
" image_url = next((img['url'] for img in data['images'] if img['nsfwLevel'] < 4), None)\n",
|
377 |
+
" elif data['images']:\n",
|
378 |
" image_url = data['images'][0]['url']\n",
|
379 |
"\n",
|
380 |
" return model_type, model_name, image_url\n",
|
files_cells/python/en/downloading_en.py
CHANGED
@@ -361,9 +361,10 @@ def extract_model_info(data, url):
|
|
361 |
model_name = data['files'][0]['name']
|
362 |
|
363 |
# Finding a safe image: less than level 4 | Kaggle
|
364 |
-
|
365 |
-
|
366 |
-
|
|
|
367 |
image_url = data['images'][0]['url']
|
368 |
|
369 |
return model_type, model_name, image_url
|
|
|
361 |
model_name = data['files'][0]['name']
|
362 |
|
363 |
# Finding a safe image: less than level 4 | Kaggle
|
364 |
+
image_url = ''
|
365 |
+
if env == 'Kaggle' and data['images']:
|
366 |
+
image_url = next((img['url'] for img in data['images'] if img['nsfwLevel'] < 4), None)
|
367 |
+
elif data['images']:
|
368 |
image_url = data['images'][0]['url']
|
369 |
|
370 |
return model_type, model_name, image_url
|
files_cells/python/ru/downloading_ru.py
CHANGED
@@ -361,9 +361,10 @@ def extract_model_info(data, url):
|
|
361 |
model_name = data['files'][0]['name']
|
362 |
|
363 |
# Finding a safe image: less than level 4 | Kaggle
|
364 |
-
|
365 |
-
|
366 |
-
|
|
|
367 |
image_url = data['images'][0]['url']
|
368 |
|
369 |
return model_type, model_name, image_url
|
|
|
361 |
model_name = data['files'][0]['name']
|
362 |
|
363 |
# Finding a safe image: less than level 4 | Kaggle
|
364 |
+
image_url = ''
|
365 |
+
if env == 'Kaggle' and data['images']:
|
366 |
+
image_url = next((img['url'] for img in data['images'] if img['nsfwLevel'] < 4), None)
|
367 |
+
elif data['images']:
|
368 |
image_url = data['images'][0]['url']
|
369 |
|
370 |
return model_type, model_name, image_url
|