Kaynağa Gözat

Added a 'clean' flag to not resume download.

Nikita Skakun 2 yıl önce
ebeveyn
işleme
8c590c2362
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      download-model.py

+ 2 - 1
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))