Skip to content

Commit 42fca3b

Browse files
authored
Deprecate archive struct (#490)
* bump version to 0.6.0 * new: deprecate gcp archive structure
1 parent 2082108 commit 42fca3b

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

fastembed/common/model_description.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
class ModelSource:
88
hf: Optional[str] = None
99
url: Optional[str] = None
10+
_deprecated_tar_struct: bool = False
11+
12+
@property
13+
def deprecated_tar_struct(self) -> bool:
14+
return self._deprecated_tar_struct
1015

1116
def __post_init__(self) -> None:
1217
if self.hf is None and self.url is None:

fastembed/common/model_management.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,10 @@ def retrieve_model_gcs(
330330
model_name: str,
331331
source_url: str,
332332
cache_dir: str,
333+
deprecated_tar_struct: bool = False,
333334
local_files_only: bool = False,
334335
) -> Path:
335-
fast_model_name = f"fast-{model_name.split('/')[-1]}"
336+
fast_model_name = f"{'fast-' if deprecated_tar_struct else ''}{model_name.split('/')[-1]}"
336337
cache_tmp_dir = Path(cache_dir) / "tmp"
337338
model_tmp_dir = cache_tmp_dir / fast_model_name
338339
model_dir = Path(cache_dir) / fast_model_name
@@ -438,6 +439,7 @@ def download_model(cls, model: T, cache_dir: str, retries: int = 3, **kwargs: An
438439
model.model,
439440
str(url_source),
440441
str(cache_dir),
442+
deprecated_tar_struct=model.sources.deprecated_tar_struct,
441443
local_files_only=local_files_only,
442444
)
443445
except Exception:

fastembed/text/onnx_embedding.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
sources=ModelSource(
2222
hf="Qdrant/fast-bge-base-en",
2323
url="https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en.tar.gz",
24+
_deprecated_tar_struct=True,
2425
),
2526
model_file="model_optimized.onnx",
2627
),
@@ -36,6 +37,7 @@
3637
sources=ModelSource(
3738
hf="qdrant/bge-base-en-v1.5-onnx-q",
3839
url="https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en-v1.5.tar.gz",
40+
_deprecated_tar_struct=True,
3941
),
4042
model_file="model_optimized.onnx",
4143
),
@@ -63,6 +65,7 @@
6365
sources=ModelSource(
6466
hf="Qdrant/bge-small-en",
6567
url="https://storage.googleapis.com/qdrant-fastembed/BAAI-bge-small-en.tar.gz",
68+
_deprecated_tar_struct=True,
6669
),
6770
model_file="model_optimized.onnx",
6871
),
@@ -90,6 +93,7 @@
9093
sources=ModelSource(
9194
hf="Qdrant/bge-small-zh-v1.5",
9295
url="https://storage.googleapis.com/qdrant-fastembed/fast-bge-small-zh-v1.5.tar.gz",
96+
_deprecated_tar_struct=True,
9397
),
9498
model_file="model_optimized.onnx",
9599
),

fastembed/text/pooled_embedding.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
sources=ModelSource(
8383
hf="qdrant/multilingual-e5-large-onnx",
8484
url="https://storage.googleapis.com/qdrant-fastembed/fast-multilingual-e5-large.tar.gz",
85+
_deprecated_tar_struct=True,
8586
),
8687
model_file="model.onnx",
8788
additional_files=["model.onnx_data"],

fastembed/text/pooled_normalized_embedding.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
sources=ModelSource(
2323
url="https://storage.googleapis.com/qdrant-fastembed/sentence-transformers-all-MiniLM-L6-v2.tar.gz",
2424
hf="qdrant/all-MiniLM-L6-v2-onnx",
25+
_deprecated_tar_struct=True,
2526
),
2627
model_file="model.onnx",
2728
),

0 commit comments

Comments
 (0)