Skip to content

Commit

Permalink
Merge branch 'master' into v3.3-release, increment to v3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Nov 18, 2024
2 parents ea49e01 + e156f38 commit f6922f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/training/prompts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Additionally, some research papers (`INSTRUCTOR <https://arxiv.org/abs/2212.0974
```eval_rst
See the following script as an example of how to train with prompts in practice:
* `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`.
* `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`.
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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sentence-transformers"
version = "3.3.0"
version = "3.3.1"
description = "State-of-the-Art Text Embeddings"
license = { text = "Apache 2.0" }
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion sentence_transformers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

__version__ = "3.3.0"
__version__ = "3.3.1"
__MODEL_HUB_ORGANIZATION__ = "sentence-transformers"

import importlib
Expand Down
10 changes: 9 additions & 1 deletion sentence_transformers/models/Transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ def __init__(

def _load_config(self, model_name_or_path: str, cache_dir: str | None, backend: str, config_args: dict[str, Any]):
"""Loads the configuration of a model"""
if find_adapter_config_file(model_name_or_path) is not None:
if (
find_adapter_config_file(
model_name_or_path,
token=config_args.get("token"),
revision=config_args.get("revision"),
local_files_only=config_args.get("local_files_only", False),
)
is not None
):
if not is_peft_available():
raise Exception(
"Loading a PEFT model requires installing the `peft` package. You can install it via `pip install peft`."
Expand Down

0 comments on commit f6922f0

Please sign in to comment.