Skip to content

Commit

Permalink
Improve cov
Browse files Browse the repository at this point in the history
Signed-off-by: Thanawan Atchariyachanvanit <[email protected]>
  • Loading branch information
thanawan-atc committed Jul 14, 2023
1 parent 4017f6b commit 33940bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions opensearch_py_ml/ml_models/sentencetransformermodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ def make_model_config_json(
normalize_result = True
else:
normalize_result = False

model_config_content = {
"name": model_name,
"version": version_number,
Expand All @@ -1091,7 +1091,7 @@ def make_model_config_json(
"embedding_dimension": embedding_dimension,
"framework_type": "sentence_transformers",
"pooling_mode": pooling_mode,
"normalize_result": normalize_result
"normalize_result": normalize_result,
"all_config": json.dumps(all_config),
},
}
Expand Down
1 change: 1 addition & 0 deletions tests/ml_commons/test_ml_commons_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def test_integration_model_train_register_full_cycle():
zip_file_name=MODEL_FILE_ZIP_NAME,
num_epochs=1,
overwrite=True,
verbose=True,
)
# second generating the config file to create metadoc of the model in opensearch.
test_model.make_model_config_json()
Expand Down
12 changes: 0 additions & 12 deletions tests/ml_models/test_sentencetransformermodel_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import json
import os
import shutil
from zipfile import ZipFile

import pytest

Expand Down Expand Up @@ -107,17 +106,6 @@ def test_missing_files():

with pytest.raises(FileNotFoundError):
test_model.read_queries(read_path="1234")

with pytest.raises(Exception) as exc_info:
empty_test_path = os.path.join(
os.path.dirname(os.path.abspath("__file__")),
"tests",
"empty_test_file.zip",
)
with ZipFile(empty_test_path, 'w') as file:
pass
test_model.read_queries(empty_test_path)
clean_test_folder(empty_test_path)

# test synthetic queries already exists in folder
with pytest.raises(Exception) as exc_info:
Expand Down

0 comments on commit 33940bb

Please sign in to comment.