Skip to content

Commit

Permalink
specific exception handle for reading sscd model's file not found exc…
Browse files Browse the repository at this point in the history
…eption
  • Loading branch information
ahmednasserswe committed Jan 29, 2024
1 parent 1a7b01b commit 80ae3fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/model/image_sscd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
#FIXME: Load from a Meedan S3 bucket
try:
self.model = torch.jit.load("sscd_disc_mixup.torchscript.pt")
except:
except FileNotFoundError:
logger.info("Downloading SSCD model...")
m=urllib.request.urlopen("https://dl.fbaipublicfiles.com/sscd-copy-detection/sscd_disc_mixup.torchscript.pt").read()
with open("sscd_disc_mixup.torchscript.pt","wb") as fh:
Expand Down

0 comments on commit 80ae3fd

Please sign in to comment.