about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/clip-anytorch/default.nix
blob: b689d5708d5f7f9ede63b0f92fcc578374e0980c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ lib
, buildPythonPackage
, fetchFromGitHub

# dependencies
, ftfy
, regex
, tqdm
, torch
, torchvision

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "clip-anytorch";
  version = "2.5.2";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "rom1504";
    repo = "CLIP";
    rev = version;
    hash = "sha256-EqVkpMQHawoCFHNupf49NrvLdGCq35wnYBpdP81Ztd4=";
  };

  propagatedBuildInputs = [
    ftfy
    regex
    tqdm
    torch
    torchvision
  ];

  pythonImportsCheck = [
    "clip"
  ];

  # all tests require network access
  doCheck = false;

  nativeCheckInputs = [
    pytestCheckHook
  ];

  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;
  };
}