1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 huggingface-hub,
7 jsonlines,
8 mean-average-precision,
9 numpy,
10 opencv-python-headless,
11 pillow,
12 torch,
13 torchvision,
14 tqdm,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "docling-ibm-models";
20 version = "2.0.4";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "DS4SD";
25 repo = "docling-ibm-models";
26 rev = "refs/tags/v${version}";
27 hash = "sha256-QZvkkazxgkGuSQKIYI+YghH7pLlDSEbCGhg89gZsOpk=";
28 };
29
30 build-system = [
31 poetry-core
32 ];
33
34 dependencies = [
35 huggingface-hub
36 jsonlines
37 mean-average-precision
38 numpy
39 opencv-python-headless
40 pillow
41 torch
42 torchvision
43 tqdm
44 ];
45
46 pythonRelaxDeps = [
47 "mean_average_precision"
48 "pillow"
49 "torchvision"
50 ];
51
52 pythonImportsCheck = [
53 "docling_ibm_models"
54 ];
55
56 nativeCheckInputs = [
57 pytestCheckHook
58 ];
59
60 disabledTests = [
61 # Requires network access
62 "test_layoutpredictor"
63 "test_tf_predictor"
64 ];
65
66 meta = {
67 changelog = "https://github.com/DS4SD/docling-ibm-models/blob/${src.rev}/CHANGELOG.md";
68 description = "Docling IBM models";
69 homepage = "https://github.com/DS4SD/docling-ibm-models";
70 license = lib.licenses.mit;
71 maintainers = with lib.maintainers; [ drupol ];
72 };
73}