Skip to content

Commit

Permalink
torch_multimodal_clip model get failed due to network issue (#2289)
Browse files Browse the repository at this point in the history
Summary:
Description:
while running model torch_multimodal_clip getting this issue
FileNotFoundError: [Errno 2] No such file or directory: 'torchbenchmark/models/torch_multimodal_clip/.data/pizza.jpg'
main reason is while downloading the pizza.jpg , getting Failed to download file with status code 403 issue so this change will resolve this issue

Pull Request resolved: #2289

Reviewed By: aaronenyeshi

Differential Revision: D58813450

Pulled By: xuzhao9

fbshipit-source-id: aa4cbee8fa4633182898fe7c1037b471505ce2ec
  • Loading branch information
arathi-hlab authored and facebook-github-bot committed Jun 20, 2024
1 parent 3bd542d commit 8de4ad3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torchbenchmark/models/torch_multimodal_clip/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

def download(output_filename, uri):
# Download the file with streaming to handle large files
response = requests.get(uri, stream=True)
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
}
response = requests.get(uri, headers=headers, stream=True)
if response.status_code == 200:
with open(output_filename, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192): # Define the chunk size to be used
Expand Down

0 comments on commit 8de4ad3

Please sign in to comment.