mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 23:16:36 +00:00
safe model saving
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
@@ -120,6 +121,8 @@ class ApiClient:
|
|||||||
part_big = resource_encrypted[part_small_size:]
|
part_big = resource_encrypted[part_small_size:]
|
||||||
|
|
||||||
self.cdn_manager.upload(constants.MODELS_FOLDER, big_part_name, part_big)
|
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:
|
with open(path.join(folder, big_part_name), 'wb') as f:
|
||||||
f.write(part_big)
|
f.write(part_big)
|
||||||
self.upload_file(small_part_name, part_small, constants.MODELS_FOLDER)
|
self.upload_file(small_part_name, part_small, constants.MODELS_FOLDER)
|
||||||
Reference in New Issue
Block a user