refac
This commit is contained in:
1 parent
2acee80829
commit
6351077958
1 file changed
+1
-2
@@ -1659,11 +1659,10 @@ async def download_file_stream(
|
|||||||
|
|
||||||
if done:
|
if done:
|
||||||
file.close()
|
file.close()
|
||||||
|
hashed = calculate_sha256(file_path, chunk_size)
|
||||||
|
|
||||||
with open(file_path, "rb") as file:
|
with open(file_path, "rb") as file:
|
||||||
chunk_size = 1024 * 1024 * 2
|
chunk_size = 1024 * 1024 * 2
|
||||||
hashed = calculate_sha256(file, chunk_size)
|
|
||||||
|
|
||||||
url = f"{ollama_url}/api/blobs/sha256:{hashed}"
|
url = f"{ollama_url}/api/blobs/sha256:{hashed}"
|
||||||
with requests.Session() as session:
|
with requests.Session() as session:
|
||||||
response = session.post(url, data=file, timeout=30)
|
response = session.post(url, data=file, timeout=30)
|
||||||
|
|||||||
Reference in new issue
Block a user