Compare commits

..
Author SHA1 Message Date
George Panchuk 5afa07b921 new: update dev workflow 2024-05-02 20:34:47 +02:00
Arun 432da42c11 fix links (#215) 2024-04-27 22:24:29 +05:30
5 changed files with 393 additions and 447 deletions
+2 -4
View File
@@ -1,10 +1,9 @@
name: Tests
run-name: Tests (dev)
on:
push:
branches: [ master, main ]
schedule:
- cron: 0 0 * * *
branches: [ dev ]
pull_request:
env:
@@ -12,7 +11,6 @@ env:
jobs:
test:
strategy:
matrix:
python-version:
+1 -1
View File
@@ -2,7 +2,7 @@
FastEmbed is a lightweight, fast, Python library built for embedding generation. We [support popular text models](https://qdrant.github.io/fastembed/examples/Supported_Models/). Please [open a GitHub issue](https://github.com/qdrant/fastembed/issues/new) if you want us to add a new model.
The default text embedding (`TextEmbedding`) model is Flag Embedding, presented in the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard. It supports "query" and "passage" prefixes for the input text. Here is an example for [Retrieval Embedding Generation](https://qdrant.github.io/fastembed/examples/Retrieval_with_FastEmbed/) and how to use [FastEmbed with Qdrant](https://qdrant.github.io/fastembed/examples/Usage_With_Qdrant/).
The default text embedding (`TextEmbedding`) model is Flag Embedding, presented in the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard. It supports "query" and "passage" prefixes for the input text. Here is an example for [Retrieval Embedding Generation](https://qdrant.github.io/fastembed/qdrant/Retrieval_with_FastEmbed/) and how to use [FastEmbed with Qdrant](https://qdrant.github.io/fastembed/qdrant/Usage_With_Qdrant/).
## 📈 Why FastEmbed?
+2 -24
View File
@@ -1,19 +1,7 @@
import os
from multiprocessing import get_all_start_methods
from pathlib import Path
from typing import (
Any,
Dict,
Generic,
Iterable,
List,
Optional,
Tuple,
Type,
TypeVar,
Union,
Sequence,
)
from typing import Any, Dict, Generic, Iterable, List, Optional, Tuple, Type, TypeVar, Union
import numpy as np
import onnxruntime as ort
@@ -51,21 +39,11 @@ class OnnxModel(Generic[T]):
model_dir: Path,
model_file: str,
threads: Optional[int],
providers: Optional[Sequence[Union[str, Tuple[str, Dict[Any, Any]]]]] = None,
) -> None:
model_path = model_dir / model_file
# List of Execution Providers: https://onnxruntime.ai/docs/execution-providers
onnx_providers = ["CPUExecutionProvider"] if providers is None else list(providers)
available_providers = ort.get_available_providers()
for provider in onnx_providers:
# check providers available
provider_name = provider if isinstance(provider, str) else provider[0]
if provider_name not in available_providers:
raise ValueError(
f"Provider {provider_name} is not available. Available providers: {available_providers}"
)
onnx_providers = ["CPUExecutionProvider"]
so = ort.SessionOptions()
so.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL
Generated
+386 -406
View File
File diff suppressed because it is too large Load Diff
+2 -12
View File
@@ -12,16 +12,8 @@ keywords = ["vector", "embedding", "neural", "search", "qdrant", "sentence-trans
[tool.poetry.dependencies]
python = ">=3.8.0,<3.13"
onnx = [
{version = "^1.15.0", optional = true, markers = "extra != 'gpu'"}
]
onnxruntime = [
{version = "^1.17.0", optional = true, markers = "extra != 'gpu'"}
]
onnxruntime-gpu = [
{ version = "^1.17.0", optional = true, python = "<3.13", markers = "extra == 'gpu'" }
]
onnx = "^1.15.0"
onnxruntime = "^1.17.0"
tqdm = "^4.66"
requests = "^2.31"
tokenizers = "^0.15.1"
@@ -45,8 +37,6 @@ pillow = "^10.2.0"
cairosvg = "^2.7.1"
mknotebooks = "^0.8.0"
[tool.poetry.extras]
gpu = ["onnxruntime-gpu"]
[build-system]
requires = ["poetry-core"]