56 lines
1.0 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
hatchling,
# dependencies
einx,
einops,
loguru,
packaging,
torch,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "x-transformers";
version = "2.5.6";
pyproject = true;
src = fetchFromGitHub {
owner = "lucidrains";
repo = "x-transformers";
tag = version;
hash = "sha256-9PUOPcTm2xvtKV4T2lAGu/3BiQZzSlwo43i0x1gbrAM=";
};
build-system = [ hatchling ];
dependencies = [
einx
einops
loguru
packaging
torch
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "x_transformers" ];
meta = {
description = "Concise but fully-featured transformer";
longDescription = ''
A simple but complete full-attention transformer with a set of promising experimental features from various papers
'';
homepage = "https://github.com/lucidrains/x-transformers";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ByteSudoer ];
};
}