1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4
5# dependencies
6, ftfy
7, regex
8, tqdm
9, torch
10, torchvision
11
12# tests
13, pytestCheckHook
14}:
15
16buildPythonPackage rec {
17 pname = "clip-anytorch";
18 version = "2.5.2";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "rom1504";
23 repo = "CLIP";
24 rev = version;
25 hash = "sha256-EqVkpMQHawoCFHNupf49NrvLdGCq35wnYBpdP81Ztd4=";
26 };
27
28 propagatedBuildInputs = [
29 ftfy
30 regex
31 tqdm
32 torch
33 torchvision
34 ];
35
36 pythonImportsCheck = [
37 "clip"
38 ];
39
40 # all tests require network access
41 doCheck = false;
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 ];
46
47 preCheck = ''
48 export HOME=$TMPDIR
49 '';
50
51 meta = with lib; {
52 description = "Contrastive Language-Image Pretraining";
53 homepage = "https://github.com/rom1504/CLIP";
54 license = licenses.mit;
55 maintainers = teams.tts.members;
56 };
57}