2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
ftfy,
|
|
|
|
regex,
|
|
|
|
tqdm,
|
|
|
|
torch,
|
|
|
|
torchvision,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "clip-anytorch";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2.6.0";
|
2023-05-24 13:37:59 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rom1504";
|
|
|
|
repo = "CLIP";
|
2024-01-25 14:12:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-4A8R9aEiOWC05uhMQslhVSkQ4hyjs6VsqkFi76miodY=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
ftfy
|
|
|
|
regex
|
|
|
|
tqdm
|
|
|
|
torch
|
|
|
|
torchvision
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "clip" ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# all tests require network access
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Contrastive Language-Image Pretraining";
|
|
|
|
homepage = "https://github.com/rom1504/CLIP";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = teams.tts.members;
|
|
|
|
};
|
|
|
|
}
|