Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.clip-server: init at 0.8.3 #317305

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions pkgs/development/python-modules/clip-server/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
buildPythonPackage,
python,
fetchPypi,
ftfy,
torch,
regex,
torchvision,
prometheus-client,
open-clip-torch,
jina,
docarray,
pillow-avif-plugin
}:

buildPythonPackage rec {
pname = "clip-server";
version = "0.8.3";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-JWz5OGpZ/e9gTjnAliccQz2aWOVmnRZbFzBNLe3NyQU=";
};

nativeBuildInputs = with python.pkgs; [
setuptools
wheel
];

propagatedBuildInputs = [
ftfy
torch
regex
torchvision
docarray
prometheus-client
open-clip-torch
pillow-avif-plugin
jina
];

pythonImportsCheck = [ "clip_server" ];

meta = with lib; {
description = "Embed images and sentences into fixed-length vectors via CLIP";
homepage = "https://pypi.org/project/clip-server";
license = licenses.asl20;
maintainers = with maintainers; [ oddlama onny ];
mainProgram = "clip-server";
};
}
110 changes: 110 additions & 0 deletions pkgs/development/python-modules/docarray/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
poetry-core,
numpy,
orjson,
pydantic,
rich,
types-requests,
typing-inspect,
# Optional dependencies
av,
elasticsearch,
elastic-transport,
fastapi,
hnswlib,
jax,
lz4,
jaxlib,
pandas,
pillow,
types-pillow,
protobuf,
pymilvus,
pydub,
qdrant-client,
redis,
smart-open,
torch,
trimesh,
weaviate-client,
}:
buildPythonPackage rec {
pname = "docarray";
version = "0.40.0";
format = "pyproject";

disabled = pythonOlder "3.8";

src = fetchFromGitHub {
inherit pname version;
owner = "docarray";
repo = "docarray";
rev = "v${version}";
hash = "sha256-Vqmfn36UYb3s5Y1OtxtHgU5bCJaWKb5Perqr6X3A9xA=";
};

build-system = [ poetry-core ];

dependencies = [
numpy
orjson
pydantic
rich
types-requests
typing-inspect
];

optional-dependencies = {
proto = [
protobuf
lz4
];
pandas = [ pandas ];
image = [
pillow
types-pillow
];
video = [ av ];
audio = [ pydub ];
mesh = [ trimesh ];
hnswlib = [
hnswlib
protobuf
];
elasticsearch = [
elasticsearch
elastic-transport
];
jac = [
# jina-hubble-sdk
];
aws = [ smart-open ];
torch = [ torch ];
web = [ fastapi ];
qdrant = [ qdrant-client ];
weaviate = [ weaviate-client ];
milvus = [ pymilvus ];
redis = [ redis ];
jax = [
jaxlib
jax
];
epsilla = [
# pyepsilla
];
};

pythonImportsCheck = [ "docarray" ];

meta = with lib; {
description = "Library expertly crafted for the representation, transmission, storage, and retrieval of multimodal data";
homepage = "https://docs.docarray.org/";
changelog = "https://github.com/docarray/docarray/blob/main/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [ loicreynier ];
};
}
28 changes: 28 additions & 0 deletions pkgs/development/python-modules/jina/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
}:
buildPythonPackage rec {
pname = "jina";
version = "3.25.1";

src = fetchPypi {
inherit pname version;
hash = "sha256-lb7nEZu0Wd7hUnkfuZdPbuy0vJ0kONZ1S1z1ZccF5gE=";
};

nativeBuildInputs = [
setuptools
];

doCheck = false;

meta = with lib; {
description = "Multimodal AI services & pipelines with cloud-native stack";
homepage = "https://github.com/jina-ai/jina";
license = licenses.asl20;
maintainers = with maintainers; [ onny ];
};
}
7 changes: 3 additions & 4 deletions pkgs/development/python-modules/langchain/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
chardet,
clarifai,
cohere,
dataclasses-json,
docarray,
esprima,
fetchFromGitHub,
freezegun,
Expand Down Expand Up @@ -45,7 +47,6 @@
transformers,
typer,
}:

buildPythonPackage rec {
pname = "langchain";
version = "0.2.1";
Expand Down Expand Up @@ -99,9 +100,7 @@ buildPythonPackage rec {
text_helpers = [ chardet ];
clarifai = [ clarifai ];
cohere = [ cohere ];
docarray = [
# docarray
];
docarray = [ docarray ];
embeddings = [ sentence-transformers ];
javascript = [ esprima ];
azure = [
Expand Down
39 changes: 39 additions & 0 deletions pkgs/development/python-modules/pillow-avif-plugin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
lib,
buildPythonPackage,
python,
fetchPypi,
libavif,
setuptools,
wheel,
pillow,
}:
buildPythonPackage rec {
pname = "pillow-avif-plugin";
version = "1.4.3";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-o3e+lNWzgQ4H4CIYBkkOjhoojzjnIiVn2BCl2haxu80=";
};

nativeBuildInputs = [
setuptools
wheel
];

propagatedBuildInputs = [
libavif
pillow
];

pythonImportsCheck = [ "pillow_avif" ];

meta = with lib; {
description = "Pillow plugin that adds avif support via libavif";
homepage = "https://github.com/fdintino/pillow-avif-plugin";
license = licenses.mit;
maintainers = with maintainers; [ onny ];
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,8 @@ self: super: with self; {

clip-anytorch = callPackage ../development/python-modules/clip-anytorch { };

clip-server = callPackage ../development/python-modules/clip-server { };

clr-loader = callPackage ../development/python-modules/clr-loader { };

cock = callPackage ../development/python-modules/cock { };
Expand Down Expand Up @@ -3462,6 +3464,8 @@ self: super: with self; {

doc8 = callPackage ../development/python-modules/doc8 { };

docarray = callPackage ../development/python-modules/docarray { };

docformatter = callPackage ../development/python-modules/docformatter { };

docker = callPackage ../development/python-modules/docker { };
Expand Down Expand Up @@ -6084,6 +6088,8 @@ self: super: with self; {

jieba = callPackage ../development/python-modules/jieba { };

jina = callPackage ../development/python-modules/jina { };

jinja2 = callPackage ../development/python-modules/jinja2 { };

jinja2-ansible-filters = callPackage ../development/python-modules/jinja2-ansible-filters { };
Expand Down Expand Up @@ -9833,6 +9839,8 @@ self: super: with self; {
inherit (pkgs.xorg) libX11 libxcb;
};

pillow-avif-plugin = callPackage ../development/python-modules/pillow-avif-plugin { };

pillow-heif = callPackage ../development/python-modules/pillow-heif { };

pillow-jpls = callPackage ../development/python-modules/pillow-jpls { };
Expand Down