diff --git a/dspy/utils/__init__.py b/dspy/utils/__init__.py index 8f5e9cf5e5..93965dbfc3 100644 --- a/dspy/utils/__init__.py +++ b/dspy/utils/__init__.py @@ -16,7 +16,7 @@ def download(url): remote_size = int(requests.head(url, allow_redirects=True).headers.get("Content-Length", 0)) local_size = os.path.getsize(filename) if os.path.exists(filename) else 0 - if local_size != remote_size: + if local_size != remote_size or remote_size == 0: print(f"Downloading '{filename}'...") with requests.get(url, stream=True) as r, open(filename, "wb") as f: for chunk in r.iter_content(chunk_size=8192):