Skip to content

Commit

Permalink
upgrade package version to fix security issues and format code (opens…
Browse files Browse the repository at this point in the history
…earch-project#51)

* upgrade package version

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

* upgrade package version

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

* upgrade package version

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

* lint format

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

* lint format

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

Signed-off-by: Mingshi Liu <mingshl@amazon.com>
  • Loading branch information
mingshl authored Dec 7, 2022
1 parent 91a35bd commit 8cfdea5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,20 @@ def __init__(
"""
default_folder_path = os.path.join(os.getcwd(), "model_files")

# check folder exist in default_folder_path
if os.path.exists(default_folder_path) and not overwrite:
if folder_path is None:
self.folder_path = default_folder_path
else:
self.folder_path = folder_path

# check folder exist in self.folder_path
if os.path.exists(self.folder_path) and not overwrite:
print(
"To prevent overwritten, please enter a different folder path or delete the 'model_files' folder or enable overwrite = True"
"To prevent overwritten, please enter a different folder path or delete the folder or enable overwrite = True"
)
raise Exception(
str(
"The default folder path already exists at : " + default_folder_path
)
str("The default folder path already exists at : " + self.folder_path)
)

if folder_path is None:
self.folder_path = default_folder_path
else:
self.folder_path = folder_path
if model_id is None:
self.model_id = "sentence-transformers/msmarco-distilbert-base-tas-b"
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pandas>=1.5,<2
matplotlib>=3.6.0,<4
numpy>=1.23.3,<2
opensearch-py>=2
torch
torch>=1.13.0
accelerate
sentence_transformers
tqdm
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pandas>=1.5,<2
matplotlib>=3.6.0,<4
numpy>=1.23.3,<2
opensearch-py>=2
torch
torch>=1.13.0
accelerate
sentence_transformers
tqdm
Expand Down
6 changes: 6 additions & 0 deletions tests/sentence_transformer_model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
# Any modifications Copyright OpenSearch Contributors. See
# GitHub history for details.

0 comments on commit 8cfdea5

Please sign in to comment.