Skip to content

Commit 43991ce

Browse files
committed
make version 1.2.1 compatible with version 2 model format
1 parent 9d08f69 commit 43991ce

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

sentence_transformers/SentenceTransformer.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,6 @@ def __init__(self, model_name_or_path: str = None, modules: Iterable[nn.Module]
106106
if model_path is not None:
107107
logger.info("Load SentenceTransformer from folder: {}".format(model_path))
108108

109-
if os.path.exists(os.path.join(model_path, 'config.json')):
110-
with open(os.path.join(model_path, 'config.json')) as fIn:
111-
config = json.load(fIn)
112-
if config['__version__'] > __version__:
113-
logger.warning("You try to use a model that was created with version {}, however, your version is {}. This might cause unexpected behavior or errors. In that case, try to update to the latest version.\n\n\n".format(config['__version__'], __version__))
114-
115109
with open(os.path.join(model_path, 'modules.json')) as fIn:
116110
contained_modules = json.load(fIn)
117111

sentence_transformers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.2.0"
1+
__version__ = "1.2.1"
22
__DOWNLOAD_SERVER__ = 'http://sbert.net/models/'
33
from .datasets import SentencesDataset, ParallelSentencesDataset
44
from .LoggingHandler import LoggingHandler

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
setup(
99
name="sentence-transformers",
10-
version="1.2.0",
10+
version="1.2.1",
1111
author="Nils Reimers",
1212
author_email="[email protected]",
1313
description="Sentence Embeddings using BERT / RoBERTa / XLM-R",
1414
long_description=readme,
1515
long_description_content_type="text/markdown",
1616
license="Apache License 2.0",
1717
url="https://github.com/UKPLab/sentence-transformers",
18-
download_url="https://github.com/UKPLab/sentence-transformers/archive/v1.2.0.zip",
18+
download_url="https://github.com/UKPLab/sentence-transformers/archive/v1.2.1.zip",
1919
packages=find_packages(),
2020
install_requires=[
2121
'transformers>=3.1.0,<5.0.0',

0 commit comments

Comments
 (0)