Skip to content
Open
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
22 changes: 18 additions & 4 deletions closed/NVIDIA/code/bert/tensorrt/download_model.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,20 @@ source code/common/file_downloads.sh

MODEL=bert

download_file models ${MODEL} https://zenodo.org/record/3733910/files/model.onnx?download=1 bert_large_v1_1.onnx
download_file models ${MODEL} https://zenodo.org/record/3750364/files/bert_large_v1_1_fake_quant.onnx?download=1 bert_large_v1_1_fake_quant.onnx
download_file models ${MODEL} https://zenodo.org/record/3750364/files/vocab.txt?download=1 vocab.txt
# Function to check if a file already exists before downloading
function download_if_not_exists {
local sub_dir=$1
local model_name=$2
local url=$3
local dest_filename=$4

if [ ! -f "${MLPERF_SCRATCH_PATH}/${sub_dir}/${model_name}/${dest_filename}" ]; then
download_file "${sub_dir}" "${model_name}" "${url}" "${dest_filename}"
else
echo "File ${MLPERF_SCRATCH_PATH}/${sub_dir}/${model_name}/${dest_filename} already exists. Skipping download."
fi
}

download_if_not_exists models ${MODEL} https://zenodo.org/record/3733910/files/model.onnx?download=1 bert_large_v1_1.onnx
download_if_not_exists models ${MODEL} https://zenodo.org/record/3750364/files/bert_large_v1_1_fake_quant.onnx?download=1 bert_large_v1_1_fake_quant.onnx
download_if_not_exists models ${MODEL} https://zenodo.org/record/3750364/files/vocab.txt?download=1 vocab.txt
Loading