From cf7b940fddea480490ea7b74c2908f88e7bf657d Mon Sep 17 00:00:00 2001 From: Jeffrey Tang <810895+jeffreyftang@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:44:00 -0500 Subject: [PATCH] fix: Enable ignoring botocore ClientError during download_file (#404) --- server/lorax_server/utils/sources/s3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/lorax_server/utils/sources/s3.py b/server/lorax_server/utils/sources/s3.py index 65d5cb450..085fbaeef 100644 --- a/server/lorax_server/utils/sources/s3.py +++ b/server/lorax_server/utils/sources/s3.py @@ -6,6 +6,7 @@ import boto3 from botocore.config import Config +from botocore.exceptions import ClientError from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE from huggingface_hub.utils import ( EntryNotFoundError, @@ -235,7 +236,7 @@ def download_file(self, filename: str, ignore_errors: bool = False) -> Optional[ try: paths = download_files_from_s3(self.bucket, filenames, self.model_id, self.revision) return paths[0] - except FileNotFoundError as e: + except ClientError as e: if ignore_errors: return None raise e