2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "rclip";
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "1.10.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yurijmikhalevich";
|
|
|
|
repo = "rclip";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-24 18:47:55 +00:00
|
|
|
hash = "sha256-02ZbeUw+O7tBQwauklaPPcgNasG+mYrSnw9TGJqtJfk=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
open-clip-torch
|
|
|
|
pillow
|
|
|
|
requests
|
|
|
|
torch
|
|
|
|
torchvision
|
|
|
|
tqdm
|
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [ pytestCheckHook pythonRelaxDepsHook ];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [ "torch" "torchvision" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "rclip" ];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# requires network
|
|
|
|
"tests/e2e/test_rclip.py"
|
|
|
|
];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
disabledTests = [
|
|
|
|
# requires network
|
|
|
|
"test_text_model_produces_the_same_vector_as_the_main_model"
|
|
|
|
"test_loads_text_model_when_text_processing_only_requested_and_checkpoint_exists"
|
|
|
|
"test_loads_full_model_when_text_processing_only_requested_and_checkpoint_doesnt_exist"
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
}
|