Fix timeout issue related to spam data backup url (#544)

* Add backup url for Spam Dataset

* import urllib

* fix url

* fix timeout issue
This commit is contained in:
Sebastian Raschka
2025-02-20 09:26:23 -06:00
committed by GitHub
parent c39aa32ef5
commit d1e99f6092
5 changed files with 10 additions and 9 deletions

View File

@@ -217,9 +217,8 @@
"\n",
"try:\n",
" download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path)\n",
"except urllib.error.HTTPError:\n",
" print(\"UCI Machine Learning Repository (https://archive.ics.uci.edu)\"\n",
" \" temporary unavailable. Using backup URL.\")\n",
"except (urllib.error.HTTPError, urllib.error.URLError, TimeoutError) as e:\n",
" print(f\"Primary URL failed: {e}. Trying backup URL...\")\n",
" url = \"https://f001.backblazeb2.com/file/LLMs-from-scratch/sms%2Bspam%2Bcollection.zip\"\n",
" download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path) "
]