From 5520cdcefb10458bda2e9da67ccdc01c0863e145 Mon Sep 17 00:00:00 2001 From: Thomas van Dongen Date: Mon, 23 Sep 2024 13:24:21 +0200 Subject: [PATCH] Fixed dims bug and bumped version (#24) --- model2vec/distill/inference.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model2vec/distill/inference.py b/model2vec/distill/inference.py index 593ca3b..d0452ae 100644 --- a/model2vec/distill/inference.py +++ b/model2vec/distill/inference.py @@ -81,7 +81,7 @@ def create_output_embeddings_from_model_name_and_tokens( def _get_embedder_output_dim(output_value: OutputValue, embedder: SentenceTransformer) -> int: """Get the embeddings dimension of a sentence transformer, given an output value.""" - embedder_output_dim = embedder.encode(["a"], show_progress_bar=False, output_value=output_value)[0].shape[0] + embedder_output_dim = embedder.encode(["a"], show_progress_bar=False, output_value=output_value)[0].shape[1] return embedder_output_dim diff --git a/pyproject.toml b/pyproject.toml index 689b81b..1ab99dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "model2vec" description = "Distill a Small Fast Model from any Sentence Transformer" readme = { file = "README.md", content-type = "text/markdown" } license = { file = "LICENSE" } -version = "0.1.1" +version = "0.1.2" requires-python = ">=3.10" authors = [{ name = "Stéphan Tulkens", email = "stephantul@gmail.com"}, {name = "Thomas van Dongen", email = "thomas123@live.nl"}]