depot/third_party/nixpkgs/pkgs/development/python-modules/timm/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

73 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
pdm-backend,
huggingface-hub,
numpy,
pyyaml,
safetensors,
torch,
torchvision,
expecttest,
pytestCheckHook,
pytest-timeout,
}:
buildPythonPackage rec {
pname = "timm";
version = "1.0.7";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "huggingface";
repo = "pytorch-image-models";
rev = "refs/tags/v${version}";
hash = "sha256-0o88gOZvHXblGPwyRIz2D3sD7wdg0J0knrAFlognEOY=";
};
build-system = [ pdm-backend ];
dependencies = [
huggingface-hub
numpy
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 ];
};
}