2c76a4cb41
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
69 lines
1.3 KiB
Nix
69 lines
1.3 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, pythonOlder
|
|
, pytestCheckHook
|
|
, expecttest
|
|
, pytest-timeout
|
|
, huggingface-hub
|
|
, pyyaml
|
|
, safetensors
|
|
, torch
|
|
, torchvision
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "timm";
|
|
version = "0.9.10";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "huggingface";
|
|
repo = "pytorch-image-models";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-PyrJhyJmuF7BZzlQ4f5fiJY5fYFC1JPRLto5ljPVbY4=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
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 = with lib; {
|
|
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 = licenses.asl20;
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
};
|
|
}
|