1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, einops
6, emoji
7, flax
8, ftfy
9, jax
10, jaxlib
11, pillow
12, transformers
13, unidecode
14, wandb
15}:
16
17buildPythonPackage rec {
18 pname = "dalle-mini";
19 version = "0.1.5";
20 format = "setuptools";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-k4XILjNNz0FPcAzwPEeqe5Lj24S2Y139uc9o/1IUS1c=";
25 };
26
27 # Fix incompatibility with the latest JAX versions
28 # See https://github.com/borisdayma/dalle-mini/pull/338
29 patches = [
30 (fetchpatch {
31 url = "https://github.com/borisdayma/dalle-mini/pull/338/commits/22ffccf03f3e207731a481e3e42bdb564ceebb69.patch";
32 hash = "sha256-LIOyfeq/oVYukG+1rfy5PjjsJcjADCjn18x/hVmLkPY=";
33 })
34 ];
35
36 propagatedBuildInputs = [
37 einops
38 emoji
39 flax
40 ftfy
41 jax
42 jaxlib
43 pillow
44 transformers
45 unidecode
46 wandb
47 ];
48
49 doCheck = false; # no upstream tests
50
51 pythonImportsCheck = [ "dalle_mini" ];
52
53 meta = with lib; {
54 description = "Generate images from a text prompt";
55 homepage = "https://github.com/borisdayma/dalle-mini";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ r-burns ];
58 };
59}