Merge pull request #270808 from iynaix/init-rclip

rclip: init at 1.7.6
This commit is contained in:
OTABI Tomoya 2023-12-06 20:21:16 +09:00 committed by GitHub
commit cf67f8ed89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 219 additions and 0 deletions

View File

@ -0,0 +1,46 @@
{ lib
, python3Packages
, fetchFromGitHub
}:
python3Packages.buildPythonApplication rec {
pname = "rclip";
version = "1.7.6";
pyproject = true;
src = fetchFromGitHub {
owner = "yurijmikhalevich";
repo = "rclip";
rev = "v${version}";
hash = "sha256-lWaWq+dcAa/2pONka4xRpixqDuL6iYDF46vCyCmVWwE=";
};
nativeBuildInputs = with python3Packages; [
poetry-core
];
propagatedBuildInputs = with python3Packages; [
open-clip-torch
pillow
requests
torch
torchvision
tqdm
];
nativeCheckInputs = with python3Packages; [ pytestCheckHook ];
pythonImportsCheck = [ "rclip" ];
disabledTestPaths = [
# requires network
"tests/e2e/test_rclip.py"
];
meta = with lib; {
description = "AI-Powered Command-Line Photo Search Tool";
homepage = "https://github.com/yurijmikhalevich/rclip";
license = licenses.mit;
maintainers = with maintainers; [ iynaix ];
mainProgram = "rclip";
};
}

View File

@ -0,0 +1,86 @@
{ lib
, stdenv
, buildPythonPackage
, braceexpand
, ftfy
, huggingface-hub
, pandas
, protobuf
, pytestCheckHook
, regex
, sentencepiece
, timm
, torch
, torchvision
, tqdm
, transformers
, setuptools
, webdataset
, wheel
, fetchFromGitHub
}:
buildPythonPackage rec {
pname = "open-clip-torch";
version = "2.23.0";
pyproject = true;
src = fetchFromGitHub {
owner = "mlfoundations";
repo = "open_clip";
rev = "v${version}";
hash = "sha256-Txm47Tc4KMbz1i2mROT+IYbgS1Y0yHK80xY0YldgBFQ=";
};
nativeBuildInputs = [
setuptools
wheel
];
propagatedBuildInputs = [
ftfy
huggingface-hub
protobuf
regex
sentencepiece
timm
torch
torchvision
tqdm
];
nativeCheckInputs = [
pytestCheckHook
braceexpand
pandas
transformers
webdataset
];
pythonImportsCheck = [ "open_clip" ];
disabledTestPaths = lib.optionals (stdenv.isAarch64 || stdenv.isDarwin) [
"tests/test_wds.py"
];
disabledTests = [
# requires network
"test_download_pretrained_from_hfh"
"test_inference_simple"
"test_inference_with_data"
"test_pretrained_text_encoder"
"test_training_mt5"
] ++ lib.optionals (stdenv.isAarch64 && stdenv.isLinux) [
"test_training"
"test_training_coca"
"test_training_unfreezing_vit"
"test_training_clip_with_jit"
];
meta = with lib; {
description = "An open source implementation of CLIP";
homepage = "https://github.com/mlfoundations/open_clip";
license = licenses.asl20;
maintainers = with maintainers; [ iynaix ];
mainProgram = "open-clip";
};
}

View File

@ -0,0 +1,83 @@
{ lib
, stdenv
, buildPythonPackage
, braceexpand
, imageio
, lmdb
, msgpack
, numpy
, pytestCheckHook
, pyyaml
, setuptools
, torch
, torchvision
, wheel
, fetchFromGitHub
}:
buildPythonPackage rec {
pname = "webdataset";
version = "0.2.79";
pyproject = true;
src = fetchFromGitHub {
owner = "webdataset";
repo = "webdataset";
rev = version;
hash = "sha256-EfQoHlJ+1spQWZkjS1hwERVUHfjGHDFxE0D+VLujJW8=";
};
nativeBuildInputs = [
setuptools
wheel
];
propagatedBuildInputs = [
braceexpand
numpy
pyyaml
];
nativeCheckInputs = [
pytestCheckHook
imageio
torch
torchvision
msgpack
lmdb
];
pythonImportsCheck = [ "webdataset" ];
disabledTests = [
# requires network
"test_batched"
"test_dataloader"
"test_decode_handlers"
"test_decoder"
"test_decoder"
"test_download"
"test_handlers"
"test_pipe"
"test_shard_syntax"
"test_torchvision"
"test_torchvision"
"test_unbatched"
"test_yaml3"
] ++ lib.optionals stdenv.isDarwin [
# pickling error
"test_background_download"
] ++ lib.optionals (stdenv.isAarch64 && stdenv.isLinux) [
# segfaults on aarch64-linux
"test_webloader"
"test_webloader2"
"test_webloader_repeat"
"test_webloader_unbatched"
];
meta = with lib; {
description = "A high-performance Python-based I/O system for large (and small) deep learning problems, with strong support for PyTorch";
homepage = "https://github.com/webdataset/webdataset";
license = licenses.bsd3;
maintainers = with maintainers; [ iynaix ];
};
}

View File

@ -8546,6 +8546,8 @@ self: super: with self; {
opcua-widgets = callPackage ../development/python-modules/opcua-widgets { };
open-clip-torch = callPackage ../development/python-modules/open-clip-torch { };
open-garage = callPackage ../development/python-modules/open-garage { };
open-meteo = callPackage ../development/python-modules/open-meteo { };
@ -15785,6 +15787,8 @@ self: super: with self; {
webcolors = callPackage ../development/python-modules/webcolors { };
webdataset = callPackage ../development/python-modules/webdataset { };
webdav4 = callPackage ../development/python-modules/webdav4 { };
webdavclient3 = callPackage ../development/python-modules/webdavclient3 { };