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

Commit

Permalink
Rehosted COCO-IMG to allow for resuming download (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Belbs authored Jul 12, 2017
1 parent c319cc9 commit 3eb00b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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/'

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

0 comments on commit 3eb00b1

Please sign in to comment.