2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
2024-06-20 14:57:18 +00:00
|
|
|
fetchFromGitHub,
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDepsHook,
|
2024-06-20 14:57:18 +00:00
|
|
|
|
|
|
|
# build-system
|
2024-06-05 15:53:02 +00:00
|
|
|
poetry-core,
|
2024-06-20 14:57:18 +00:00
|
|
|
|
|
|
|
# dependencies
|
|
|
|
huggingface-hub,
|
|
|
|
loguru,
|
|
|
|
mmh3,
|
|
|
|
numpy,
|
2024-06-05 15:53:02 +00:00
|
|
|
onnx,
|
|
|
|
onnxruntime,
|
2024-06-20 14:57:18 +00:00
|
|
|
pillow,
|
|
|
|
pystemmer,
|
2024-06-05 15:53:02 +00:00
|
|
|
requests,
|
2024-06-20 14:57:18 +00:00
|
|
|
snowballstemmer,
|
2024-06-05 15:53:02 +00:00
|
|
|
tokenizers,
|
|
|
|
tqdm,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
buildPythonPackage rec {
|
2023-10-09 19:29:22 +00:00
|
|
|
pname = "fastembed";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.3.0";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qdrant";
|
|
|
|
repo = "fastembed";
|
2023-10-19 13:55:26 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-Tfj0YdUW/Nnvn4+RoOWj9l0gDkWbpVgiADA09ht4xxM=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dependencies = [
|
2024-02-29 20:09:43 +00:00
|
|
|
huggingface-hub
|
2024-06-05 15:53:02 +00:00
|
|
|
loguru
|
2024-06-20 14:57:18 +00:00
|
|
|
mmh3
|
|
|
|
numpy
|
2024-02-29 20:09:43 +00:00
|
|
|
onnx
|
2023-10-09 19:29:22 +00:00
|
|
|
onnxruntime
|
2024-06-20 14:57:18 +00:00
|
|
|
pillow
|
|
|
|
pystemmer
|
2023-10-09 19:29:22 +00:00
|
|
|
requests
|
2024-06-20 14:57:18 +00:00
|
|
|
snowballstemmer
|
2023-10-09 19:29:22 +00:00
|
|
|
tokenizers
|
|
|
|
tqdm
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "fastembed" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
pythonRelaxDeps = [ "onnxruntime" ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# there is one test and it requires network
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
meta = {
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Fast, Accurate, Lightweight Python library to make State of the Art Embedding";
|
|
|
|
homepage = "https://github.com/qdrant/fastembed";
|
2024-06-20 14:57:18 +00:00
|
|
|
changelog = "https://github.com/qdrant/fastembed/releases/tag/v${version}";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ happysalada ];
|
|
|
|
# terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException'
|
|
|
|
badPlatforms = [ "aarch64-linux" ];
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
}
|