model2vec 0.3.4__tar.gz → 0.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {model2vec-0.3.4 → model2vec-0.3.5}/PKG-INFO +2 -2
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/distill/distillation.py +13 -6
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/version.py +1 -1
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec.egg-info/PKG-INFO +2 -2
- {model2vec-0.3.4 → model2vec-0.3.5}/uv.lock +1 -1
- {model2vec-0.3.4 → model2vec-0.3.5}/.github/workflows/ci.yaml +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/.gitignore +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/.pre-commit-config.yaml +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/LICENSE +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/Makefile +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/README.md +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/logo.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/logo_v2.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/model2vec_model_diagram.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/model2vec_model_diagram_transparant_dark.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/model2vec_model_diagram_transparant_light.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/sentences_per_second_vs_average_score.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/speed_vs_accuracy.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/speed_vs_accuracy_v2.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/speed_vs_accuracy_v3.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/speed_vs_accuracy_v4.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/speed_vs_mteb_score.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/speed_vs_mteb_score_v2.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/assets/images/tutorial_ezlo.png +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/__init__.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/distill/__init__.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/distill/inference.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/distill/tokenizer.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/distill/utils.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/hf_utils.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/model.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/model_card_template.md +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec/utils.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec.egg-info/SOURCES.txt +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec.egg-info/dependency_links.txt +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec.egg-info/requires.txt +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/model2vec.egg-info/top_level.txt +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/pyproject.toml +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/results/README.md +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/scripts/export_to_onnx.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/setup.cfg +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/__init__.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/conftest.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/data/test_tokenizer/special_tokens_map.json +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/data/test_tokenizer/tokenizer.json +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/data/test_tokenizer/tokenizer_config.json +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/test_distillation.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/test_model.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tests/test_utils.py +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tutorials/README.md +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tutorials/recipe_search.ipynb +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tutorials/semantic_chunking.ipynb +0 -0
- {model2vec-0.3.4 → model2vec-0.3.5}/tutorials/semantic_deduplication.ipynb +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: model2vec
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: The Fastest State-of-the-Art Static Embeddings in the World
|
|
5
5
|
Author-email: Stéphan Tulkens <stephantul@gmail.com>, Thomas van Dongen <thomas123@live.nl>
|
|
6
6
|
License: MIT License
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import os
|
|
4
5
|
import re
|
|
5
6
|
from typing import Literal, Union
|
|
6
7
|
|
|
@@ -141,13 +142,19 @@ def distill_from_model(
|
|
|
141
142
|
"hidden_dim": embeddings.shape[1],
|
|
142
143
|
"seq_length": 1000000, # Set this to a high value since we don't have a sequence length limit.
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
except RepositoryNotFoundError:
|
|
149
|
-
logger.info("No model info found for model. Setting `language` to None.")
|
|
145
|
+
|
|
146
|
+
if os.path.exists(model_name):
|
|
147
|
+
# Using a local model. Get the model name from the path.
|
|
148
|
+
model_name = os.path.basename(model_name)
|
|
150
149
|
language = None
|
|
150
|
+
else:
|
|
151
|
+
# Get the language from the model card.
|
|
152
|
+
try:
|
|
153
|
+
info = model_info(model_name)
|
|
154
|
+
language = info.cardData.get("language", None)
|
|
155
|
+
except RepositoryNotFoundError:
|
|
156
|
+
logger.info("No model info found for the model. Setting language to None.")
|
|
157
|
+
language = None
|
|
151
158
|
|
|
152
159
|
return StaticModel(
|
|
153
160
|
vectors=embeddings, tokenizer=new_tokenizer, config=config, base_model_name=model_name, language=language
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version_triple__ = (0, 3,
|
|
1
|
+
__version_triple__ = (0, 3, 5)
|
|
2
2
|
__version__ = ".".join(map(str, __version_triple__))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: model2vec
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: The Fastest State-of-the-Art Static Embeddings in the World
|
|
5
5
|
Author-email: Stéphan Tulkens <stephantul@gmail.com>, Thomas van Dongen <thomas123@live.nl>
|
|
6
6
|
License: MIT License
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model2vec-0.3.4 → model2vec-0.3.5}/assets/images/model2vec_model_diagram_transparant_dark.png
RENAMED
|
File without changes
|
{model2vec-0.3.4 → model2vec-0.3.5}/assets/images/model2vec_model_diagram_transparant_light.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|