Checksum code now activated by --check flag.

This commit is contained in:
Nikita Skakun 2023-03-30 20:06:12 -07:00
parent d550c12a3e
commit 0cc89e7755

View File

@ -26,6 +26,7 @@ parser.add_argument('--threads', type=int, default=1, help='Number of files to d
parser.add_argument('--text-only', action='store_true', help='Only download text files (txt/json).') parser.add_argument('--text-only', action='store_true', help='Only download text files (txt/json).')
parser.add_argument('--output', type=str, default=None, help='The folder where the model should be saved.') parser.add_argument('--output', type=str, default=None, help='The folder where the model should be saved.')
parser.add_argument('--clean', action='store_true', help='Does not resume the previous download.') parser.add_argument('--clean', action='store_true', help='Does not resume the previous download.')
parser.add_argument('--check', action='store_true', help='Validates the checksums of model files.')
args = parser.parse_args() args = parser.parse_args()
def get_file(url, output_folder): def get_file(url, output_folder):
@ -215,6 +216,7 @@ if __name__ == '__main__':
print(f"Downloading the model to {output_folder}") print(f"Downloading the model to {output_folder}")
download_files(links, output_folder, args.threads) download_files(links, output_folder, args.threads)
if args.check:
# Validate the checksums # Validate the checksums
validated = True validated = True
for i in range(len(sha256)): for i in range(len(sha256)):