|
1 | 1 | from typing import Any, Iterable, Optional, Sequence, Type, Union |
2 | 2 |
|
3 | | -import numpy as np |
4 | 3 | from fastembed.common.types import NumpyArray, OnnxProvider |
5 | 4 | from fastembed.common.onnx_model import OnnxOutputContext |
6 | 5 | from fastembed.common.utils import define_cache_dir, normalize |
|
21 | 20 | sources=ModelSource( |
22 | 21 | hf="Qdrant/fast-bge-base-en", |
23 | 22 | url="https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en.tar.gz", |
| 23 | + _deprecated_tar_struct=True, |
24 | 24 | ), |
25 | 25 | model_file="model_optimized.onnx", |
26 | 26 | ), |
|
36 | 36 | sources=ModelSource( |
37 | 37 | hf="qdrant/bge-base-en-v1.5-onnx-q", |
38 | 38 | url="https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en-v1.5.tar.gz", |
| 39 | + _deprecated_tar_struct=True, |
39 | 40 | ), |
40 | 41 | model_file="model_optimized.onnx", |
41 | 42 | ), |
|
63 | 64 | sources=ModelSource( |
64 | 65 | hf="Qdrant/bge-small-en", |
65 | 66 | url="https://storage.googleapis.com/qdrant-fastembed/BAAI-bge-small-en.tar.gz", |
| 67 | + _deprecated_tar_struct=True, |
66 | 68 | ), |
67 | 69 | model_file="model_optimized.onnx", |
68 | 70 | ), |
|
90 | 92 | sources=ModelSource( |
91 | 93 | hf="Qdrant/bge-small-zh-v1.5", |
92 | 94 | url="https://storage.googleapis.com/qdrant-fastembed/fast-bge-small-zh-v1.5.tar.gz", |
| 95 | + _deprecated_tar_struct=True, |
93 | 96 | ), |
94 | 97 | model_file="model_optimized.onnx", |
95 | 98 | ), |
@@ -309,7 +312,7 @@ def _post_process_onnx_output(self, output: OnnxOutputContext) -> Iterable[Numpy |
309 | 312 | processed_embeddings = embeddings |
310 | 313 | else: |
311 | 314 | raise ValueError(f"Unsupported embedding shape: {embeddings.shape}") |
312 | | - return normalize(processed_embeddings).astype(np.float32) |
| 315 | + return normalize(processed_embeddings) |
313 | 316 |
|
314 | 317 | def load_onnx_model(self) -> None: |
315 | 318 | self._load_onnx_model( |
|
0 commit comments