Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Rehosted COCO-IMG to allow for resuming download #202

Merged
merged 1 commit into from
Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions parlai/core/build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def download(url, path, fname, redownload=False):
if resume and response.headers.get('Accept-Ranges', 'none') == 'none':
resume_pos = 0
mode = 'wb'
elif resume:
print('resuming download')

CHUNK_SIZE = 32768
total_size = int(response.headers.get('Content-Length', -1))
Expand Down
9 changes: 4 additions & 5 deletions parlai/tasks/vqa_v1/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ def buildImage(opt):
fname2 = 'val2014.zip'
fname3 = 'test2015.zip'

url1 = 'http://msvocds.blob.core.windows.net/coco2014/'
url2 = 'http://msvocds.blob.core.windows.net/coco2015/'
url = 'https://s3.amazonaws.com/fair-data/parlai/COCO-IMG/'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feelsgood


build_data.download(url1 + fname1, dpath, fname1)
build_data.download(url1 + fname2, dpath, fname2)
build_data.download(url2 + fname3, dpath, fname3)
build_data.download(url + fname1, dpath, fname1)
build_data.download(url + fname2, dpath, fname2)
build_data.download(url + fname3, dpath, fname3)

build_data.untar(dpath, fname1)
build_data.untar(dpath, fname2)
Expand Down