diff --git a/download-model.py b/download-model.py index 94524f76..ed8a047d 100644 --- a/download-model.py +++ b/download-model.py @@ -24,12 +24,13 @@ parser.add_argument('--branch', type=str, default='main', help='Name of the Git parser.add_argument('--threads', type=int, default=1, help='Number of files to download simultaneously.') 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('--clean', action='store_true', help='Does not resume the previous download.') args = parser.parse_args() def get_file(url, output_folder): filename = Path(url.rsplit('/', 1)[1]) output_path = output_folder / filename - if output_path.exists(): + if output_path.exists() and not args.clean: # Check if the file has already been downloaded completely r = requests.head(url) total_size = int(r.headers.get('content-length', 0))