From c4d5886642b71f3fb965ba0ecbcf796345d4b229 Mon Sep 17 00:00:00 2001 From: Tim Isbister Date: Mon, 23 Oct 2023 11:18:54 +0200 Subject: [PATCH] Update hf_models.py Added `sentence-transformers/paraphrase-multilingual-mpnet-base-v2` --- src/seb/seb_models/hf_models.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/seb/seb_models/hf_models.py b/src/seb/seb_models/hf_models.py index 28501a56..cbc5fef5 100644 --- a/src/seb/seb_models/hf_models.py +++ b/src/seb/seb_models/hf_models.py @@ -59,6 +59,21 @@ def create_multilingual_mini_lm_l12_v2() -> SebModel: ) +@models.register("sentence-transformers/paraphrase-multilingual-mpnet-base-v2") +def create_multilingual_mpnet_base_v2() -> SebModel: + hf_name = "sentence-transformers/paraphrase-multilingual-mpnet-base-v2" + meta = ModelMeta( + name=hf_name.split("/")[-1], + huggingface_name=hf_name, + reference=f"https://huggingface.co/{hf_name}", + languages=[], + ) + return SebModel( + loader=partial(get_sentence_transformer, model_name=hf_name), # type: ignore + meta=meta, + ) + + @models.register("KBLab/sentence-bert-swedish-cased") def create_sentence_swedish_cased() -> SebModel: hf_name = "KBLab/sentence-bert-swedish-cased"