Skip to content

Commit

Permalink
commit to support the docker detatched mode
Browse files Browse the repository at this point in the history
  • Loading branch information
anandhu-eng authored Dec 2, 2024
1 parent af668b1 commit 65ebbed
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions igb/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def check_md5sum(dataset_type, dataset_size, filename):
raise Exception(" md5sum verification failed!.")


def download_dataset(path, dataset_type, dataset_size):
def download_dataset(path, dataset_type, dataset_size, confirm_download):
output_directory = path
url = dataset_urls[dataset_type][dataset_size]
filename = path + "/igb_" + dataset_type + "_" + dataset_size + ".tar.gz"
# check if the dataset is already downloaded
if os.path.exists(filename):
print("Dataset already downloaded.")
elif decide_download(url):
elif confirm_download or decide_download(url):
data = ur.urlopen(url)
size = int(data.info()["Content-Length"])
chunk_size = 1024*1024
Expand Down Expand Up @@ -103,6 +103,10 @@ def download_dataset(path, dataset_type, dataset_size):
parser.add_argument('--dataset_size', type=str, default='tiny',
choices=['tiny', 'small', 'medium'],
help='size of the datasets')
parser.add_argument(
"--confirm-download",
action="store_true",
help="To skip the user prompt for confirming the download, which is useful for Docker detached mode.")
args = parser.parse_args()
download_dataset(args.path, args.dataset_type, args.dataset_size)
download_dataset(args.path, args.dataset_type, args.dataset_size, args.confirm_download)

0 comments on commit 65ebbed

Please sign in to comment.