depot/third_party/nixpkgs/pkgs/development/python-modules/timm/default.nix
Default email ae2dc6aea6 Project import generated by Copybara.
GitOrigin-RevId: 4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0
2024-10-11 07:15:48 +02:00

74 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
pdm-backend,
# dependencies
huggingface-hub,
pyyaml,
safetensors,
torch,
torchvision,
# checks
expecttest,
pytestCheckHook,
pytest-timeout,
}:
buildPythonPackage rec {
pname = "timm";
version = "1.0.11";
pyproject = true;
src = fetchFromGitHub {
owner = "huggingface";
repo = "pytorch-image-models";
rev = "refs/tags/v${version}";
hash = "sha256-+e4+k1Oyxf94rLsOTWfMl5YWTteXgSoecvbyxL348kg=";
};
build-system = [ pdm-backend ];
dependencies = [
huggingface-hub
pyyaml
safetensors
torch
torchvision
];
nativeCheckInputs = [
expecttest
pytestCheckHook
pytest-timeout
];
pytestFlagsArray = [ "tests" ];
disabledTestPaths = [
# Takes too long and also tries to download models
"tests/test_models.py"
];
disabledTests = [
# AttributeError: 'Lookahead' object has no attribute '_optimizer_step_pre...
"test_lookahead"
];
pythonImportsCheck = [
"timm"
"timm.data"
];
meta = {
description = "PyTorch image models, scripts, and pretrained weights";
homepage = "https://huggingface.co/docs/timm/index";
changelog = "https://github.com/huggingface/pytorch-image-models/blob/v${version}/README.md#whats-new";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ bcdarwin ];
};
}