diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000..ea76c8e --- /dev/null +++ b/utils/__init__.py @@ -0,0 +1 @@ +# This file can be empty - it just marks the directory as a Python package diff --git a/utils/download.py b/utils/download.py index aedb731..9458f30 100644 --- a/utils/download.py +++ b/utils/download.py @@ -305,6 +305,17 @@ def download_file_temp( chunk_size_in_mb=16, file_integrity_check_callback=None, ): + """ + Downloads a file from a URL to a temporary location and yields the path. + Automatically cleans up the temporary file after use. + + Args: + url (str): The URL to download from + + Yields: + str: Path to the temporary downloaded file + """ + file_name = _parse_filename(url, None) with tempfile.TemporaryDirectory() as temp_dir: