1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 huggingface-hub,
6 pythonOlder,
7 pythonRelaxDepsHook,
8 poetry-core,
9 onnx,
10 onnxruntime,
11 requests,
12 tokenizers,
13 tqdm,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "fastembed";
19 version = "0.2.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "qdrant";
26 repo = "fastembed";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-ufgco5wPBG19GM99rZV7LKQqEzzCv24I8026SMz0CH4=";
29 };
30
31 nativeBuildInputs = [
32 poetry-core
33 pythonRelaxDepsHook
34 ];
35
36 propagatedBuildInputs = [
37 huggingface-hub
38 onnx
39 onnxruntime
40 requests
41 tokenizers
42 tqdm
43 ];
44
45 pythonImportsCheck = [ "fastembed" ];
46
47 pythonRelaxDeps = [ "huggingface-hub" ];
48
49 nativeCheckInputs = [ pytestCheckHook ];
50
51 # there is one test and it requires network
52 doCheck = false;
53
54 meta = with lib; {
55 description = "Fast, Accurate, Lightweight Python library to make State of the Art Embedding";
56 homepage = "https://github.com/qdrant/fastembed";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ happysalada ];
59 };
60}