Support create file with size 0 (#984)

* Support file size == 0
This commit is contained in:
tastelikefeet
2024-09-11 19:35:02 +08:00
committed by GitHub
parent 469159de34
commit 51b33cecef

View File

@@ -471,7 +471,7 @@ def http_get_model_file(
with open(temp_file_path, 'rb') as f:
partial_length = f.seek(0, io.SEEK_END)
progress.update(partial_length)
if partial_length >= file_size:
if partial_length >= file_size > 0:
break
# closed range[], from 0.
get_headers['Range'] = 'bytes=%s-%s' % (partial_length,