diff --git a/promptify/models/nlp/utils/utils.py b/promptify/models/nlp/utils/utils.py index e2f46a5..12e1fe9 100644 --- a/promptify/models/nlp/utils/utils.py +++ b/promptify/models/nlp/utils/utils.py @@ -15,7 +15,7 @@ def download(url, destination_file): os.makedirs(path) destination_file = os.path.join(path, destination_file) - + last_modified = "" if os.path.exists(destination_file): mtime = os.path.getmtime(destination_file) headers["if-modified-since"] = formatdate(mtime, usegmt=True) @@ -31,7 +31,7 @@ def download(url, destination_file): for chunk in response.iter_content(chunk_size=1048576): f.write(chunk) - if last_modified := response.headers.get("last-modified"): + if last_modified == response.headers.get("last-modified"): new_mtime = parsedate_to_datetime(last_modified).timestamp() os.utime(destination_file, times=(datetime.now().timestamp(), new_mtime)) return destination_file