kgmodule-utils 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/PKG-INFO +1 -1
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/pyproject.toml +22 -1
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/__init__.py +1 -1
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/embedder.py +12 -1
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/LICENSE +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/README.md +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/embed.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/py.typed +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/snapshots/__init__.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/snapshots/manager.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/snapshots/models.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/types/__init__.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/types/extractor.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/types/module.py +0 -0
- {kgmodule_utils-0.2.2 → kgmodule_utils-0.2.4}/src/kg_utils/types/specs.py +0 -0
|
@@ -10,7 +10,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "kgmodule-utils"
|
|
13
|
-
version = "0.2.
|
|
13
|
+
version = "0.2.4"
|
|
14
14
|
description = "Shared types and snapshot infrastructure for the KGModule SDK"
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
license = { text = "Elastic-2.0" }
|
|
@@ -52,8 +52,29 @@ target-version = ["py312", "py313"]
|
|
|
52
52
|
line-length = 100
|
|
53
53
|
target-version = "py312"
|
|
54
54
|
|
|
55
|
+
[tool.pylint.main]
|
|
56
|
+
source-roots = ["src"]
|
|
57
|
+
init-hook = "import sys; sys.path.insert(0, 'src')"
|
|
58
|
+
|
|
59
|
+
[tool.pylint."messages control"]
|
|
60
|
+
disable = [
|
|
61
|
+
"missing-module-docstring",
|
|
62
|
+
]
|
|
63
|
+
|
|
55
64
|
[tool.mypy]
|
|
56
65
|
python_version = "3.12"
|
|
57
66
|
strict = true
|
|
58
67
|
warn_unused_ignores = true
|
|
59
68
|
disallow_untyped_defs = true
|
|
69
|
+
|
|
70
|
+
[[tool.mypy.overrides]]
|
|
71
|
+
module = [
|
|
72
|
+
"sentence_transformers.*",
|
|
73
|
+
"transformers.*",
|
|
74
|
+
"numpy.*",
|
|
75
|
+
]
|
|
76
|
+
ignore_missing_imports = true
|
|
77
|
+
|
|
78
|
+
[[tool.mypy.overrides]]
|
|
79
|
+
module = "kg_utils.embedder"
|
|
80
|
+
disallow_untyped_calls = false
|
|
@@ -95,6 +95,16 @@ def load_sentence_transformer(model_name: str = DEFAULT_MODEL) -> Any:
|
|
|
95
95
|
"""
|
|
96
96
|
from sentence_transformers import SentenceTransformer # pylint: disable=import-outside-toplevel
|
|
97
97
|
|
|
98
|
+
try:
|
|
99
|
+
from transformers import logging as hf_logging # pylint: disable=import-outside-toplevel
|
|
100
|
+
|
|
101
|
+
hf_logging.set_verbosity_error()
|
|
102
|
+
hf_logging.disable_progress_bar() # TQDM_DISABLE alone misses transformers' _tqdm_active gate
|
|
103
|
+
except ImportError:
|
|
104
|
+
pass
|
|
105
|
+
|
|
106
|
+
os.environ["TQDM_DISABLE"] = "1"
|
|
107
|
+
|
|
98
108
|
resolved = KNOWN_MODELS.get(model_name, model_name)
|
|
99
109
|
trust_remote = "nomic-ai/" in resolved
|
|
100
110
|
local_path = resolve_model_path(resolved)
|
|
@@ -133,7 +143,8 @@ class SentenceTransformerEmbedder(Embedder):
|
|
|
133
143
|
try:
|
|
134
144
|
from transformers import logging as hf_logging # pylint: disable=import-outside-toplevel
|
|
135
145
|
|
|
136
|
-
hf_logging.set_verbosity_error()
|
|
146
|
+
hf_logging.set_verbosity_error()
|
|
147
|
+
hf_logging.disable_progress_bar()
|
|
137
148
|
except ImportError:
|
|
138
149
|
pass
|
|
139
150
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|