Skip to content

Commit

Permalink
fix: Enable ignoring botocore ClientError during download_file (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyftang authored Apr 9, 2024
1 parent 9651e22 commit cf7b940
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/lorax_server/utils/sources/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

0 comments on commit cf7b940

Please sign in to comment.