2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
fetchpatch,
|
|
|
|
einops,
|
|
|
|
emoji,
|
|
|
|
flax,
|
|
|
|
ftfy,
|
|
|
|
jax,
|
|
|
|
jaxlib,
|
|
|
|
pillow,
|
|
|
|
transformers,
|
|
|
|
unidecode,
|
|
|
|
wandb,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dalle-mini";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.1.5";
|
|
|
|
format = "setuptools";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-k4XILjNNz0FPcAzwPEeqe5Lj24S2Y139uc9o/1IUS1c=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# Fix incompatibility with the latest JAX versions
|
|
|
|
# See https://github.com/borisdayma/dalle-mini/pull/338
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/borisdayma/dalle-mini/pull/338/commits/22ffccf03f3e207731a481e3e42bdb564ceebb69.patch";
|
|
|
|
hash = "sha256-LIOyfeq/oVYukG+1rfy5PjjsJcjADCjn18x/hVmLkPY=";
|
|
|
|
})
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
einops
|
|
|
|
emoji
|
|
|
|
flax
|
|
|
|
ftfy
|
|
|
|
jax
|
2023-11-16 04:20:00 +00:00
|
|
|
jaxlib
|
2022-06-16 17:23:12 +00:00
|
|
|
pillow
|
|
|
|
transformers
|
|
|
|
unidecode
|
|
|
|
wandb
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false; # no upstream tests
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "dalle_mini" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Generate images from a text prompt";
|
|
|
|
homepage = "https://github.com/borisdayma/dalle-mini";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ r-burns ];
|
|
|
|
};
|
|
|
|
}
|