Skip to content

Instantly share code, notes, and snippets.

@phineas-pta
phineas-pta / dl_requests_tqdm.py
Last active April 18, 2024 16:10 — forked from yanqd0/dl_requests_tqdm.py
Python requests download file with a tqdm progress bar
import os
import requests
import werkzeug
from tqdm import tqdm
def download_ckpt(url:str, filename:str="", overwrite:bool=False, chunk_size:int=1) -> None:
"""
try auto detect file name if left empty
option to overwrite if file already existed