Skip to content

Commit f6922f0

Browse files
committed
Merge branch 'master' into v3.3-release, increment to v3.3.1
2 parents ea49e01 + e156f38 commit f6922f0

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

examples/training/prompts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Additionally, some research papers (`INSTRUCTOR <https://arxiv.org/abs/2212.0974
9696
```eval_rst
9797
See the following script as an example of how to train with prompts in practice:
9898
99-
* `training_nq_prompts.py <training_nq_prompts.py>`_: This script finetunes `mpnet-base <https://huggingface.co/microsoft/mpnet-base>`_ on 100k query-answer pairs from the `natural-questions <https://huggingface.co/datasets/sentence-transformers/natural-questions>`_ dataset using the :class:`~sentence_transformers.losses.CachedMultipleNegativesRankingLoss` loss. The model is evaluated during training using the :class:`~sentence_transformers.evaluation.NanoBEIREvaluator`.
99+
* `training_nq_prompts.py <https://github.com/UKPLab/sentence-transformers/blob/master/examples/training/prompts/training_nq_prompts.py>`_: This script finetunes `mpnet-base <https://huggingface.co/microsoft/mpnet-base>`_ on 100k query-answer pairs from the `natural-questions <https://huggingface.co/datasets/sentence-transformers/natural-questions>`_ dataset using the :class:`~sentence_transformers.losses.CachedMultipleNegativesRankingLoss` loss. The model is evaluated during training using the :class:`~sentence_transformers.evaluation.NanoBEIREvaluator`.
100100
101101
This script has two variables that affect 1) whether prompts are used and 2) whether prompts are included in the pooling. I have finetuned both ``mpnet-base`` and ``bert-base-uncased`` under the various different settings, resulting in a 0.66% and 0.90% relative improvements on ``NDCG@10`` at no extra cost.
102102

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sentence-transformers"
3-
version = "3.3.0"
3+
version = "3.3.1"
44
description = "State-of-the-Art Text Embeddings"
55
license = { text = "Apache 2.0" }
66
readme = "README.md"

sentence_transformers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
__version__ = "3.3.0"
3+
__version__ = "3.3.1"
44
__MODEL_HUB_ORGANIZATION__ = "sentence-transformers"
55

66
import importlib

sentence_transformers/models/Transformer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,15 @@ def __init__(
101101

102102
def _load_config(self, model_name_or_path: str, cache_dir: str | None, backend: str, config_args: dict[str, Any]):
103103
"""Loads the configuration of a model"""
104-
if find_adapter_config_file(model_name_or_path) is not None:
104+
if (
105+
find_adapter_config_file(
106+
model_name_or_path,
107+
token=config_args.get("token"),
108+
revision=config_args.get("revision"),
109+
local_files_only=config_args.get("local_files_only", False),
110+
)
111+
is not None
112+
):
105113
if not is_peft_available():
106114
raise Exception(
107115
"Loading a PEFT model requires installing the `peft` package. You can install it via `pip install peft`."

0 commit comments

Comments
 (0)