2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, pytestCheckHook
|
|
|
|
, expecttest
|
|
|
|
, pytest-timeout
|
|
|
|
, huggingface-hub
|
|
|
|
, pyyaml
|
2023-05-24 13:37:59 +00:00
|
|
|
, safetensors
|
2023-02-02 18:25:31 +00:00
|
|
|
, torch
|
|
|
|
, torchvision
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "timm";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.9.12";
|
2023-05-24 13:37:59 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-04-12 12:48:02 +00:00
|
|
|
owner = "huggingface";
|
2023-02-02 18:25:31 +00:00
|
|
|
repo = "pytorch-image-models";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-dDd/Sjy4xmJlaAg+fOxxcuX3FX//uJJkW0q3AaeCfns=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
huggingface-hub
|
|
|
|
pyyaml
|
2023-05-24 13:37:59 +00:00
|
|
|
safetensors
|
2023-02-02 18:25:31 +00:00
|
|
|
torch
|
|
|
|
torchvision
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
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"
|
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"timm"
|
|
|
|
"timm.data"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "PyTorch image models, scripts, and pretrained weights";
|
|
|
|
homepage = "https://huggingface.co/docs/timm/index";
|
2023-04-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/huggingface/pytorch-image-models/blob/v${version}/README.md#whats-new";
|
2023-02-02 18:25:31 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|