5ca88bfbb9
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
77 lines
1.4 KiB
Nix
77 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
pythonOlder,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
pdm-backend,
|
|
|
|
# dependencies
|
|
huggingface-hub,
|
|
pyyaml,
|
|
safetensors,
|
|
torch,
|
|
torchvision,
|
|
|
|
# checks
|
|
expecttest,
|
|
pytestCheckHook,
|
|
pytest-timeout,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "timm";
|
|
version = "1.0.8";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "huggingface";
|
|
repo = "pytorch-image-models";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-z7v1CTwIqdF8xhfGa2mtFi0sFjhOhM7X/q1OQ5qHA7c=";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|