Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Signed-off-by: thanawan-atc <[email protected]>
  • Loading branch information
thanawan-atc committed Sep 16, 2023
1 parent c87906b commit 57f91d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions opensearch_py_ml/ml_commons/model_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _register_model(

model_content_size_in_bytes = os.stat(model_path).st_size
total_num_chunks: int = ceil(model_content_size_in_bytes / MODEL_CHUNK_MAX_SIZE)

if isVerbose:
print("Total number of chunks", total_num_chunks)

Expand All @@ -93,16 +93,18 @@ def _register_model(
model_meta_json_file
)
model_meta_json[TOTAL_CHUNKS_FIELD] = total_num_chunks

if MODEL_CONTENT_SIZE_IN_BYTES_FIELD not in model_meta_json:
model_meta_json[MODEL_CONTENT_SIZE_IN_BYTES_FIELD] = model_content_size_in_bytes
model_meta_json[
MODEL_CONTENT_SIZE_IN_BYTES_FIELD
] = model_content_size_in_bytes
if MODEL_CONTENT_HASH_VALUE not in model_meta_json:
# Generate the sha1 hash for the model zip file
hash_val_model_file = _generate_model_content_hash_value(model_path)
model_meta_json[MODEL_CONTENT_HASH_VALUE] = hash_val_model_file
if isVerbose:
print("Sha1 value of the model file: ", hash_val_model_file)

model_meta_json[MODEL_GROUP_ID] = model_group_id

if self._check_mandatory_field(model_meta_json):
Expand Down

0 comments on commit 57f91d2

Please sign in to comment.