safe model saving

This commit is contained in:
Alex Bezdieniezhnykh
2025-05-31 19:09:42 +03:00
parent c9f2c167e2
commit b59392b78b
+3
View File
@@ -1,5 +1,6 @@
import io
import json
import os
from http import HTTPStatus
from os import path
@@ -120,6 +121,8 @@ class ApiClient:
part_big = resource_encrypted[part_small_size:]
self.cdn_manager.upload(constants.MODELS_FOLDER, big_part_name, part_big)
os.makedirs(folder, exist_ok=True)
with open(path.join(folder, big_part_name), 'wb') as f:
f.write(part_big)
self.upload_file(small_part_name, part_small, constants.MODELS_FOLDER)