Skip to content

Commit 7adb835

Browse files
committed
Merge branch 'llm-pipeline' of github.com:Bepitic/anomalib into llm-pipeline
Signed-off-by: Bepitic <bepitic@gmail.com>
2 parents 44586d6 + 45bd520 commit 7adb835

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
myst-parser
22
nbsphinx
33
pandoc
4-
sphinx<8.0 # 7.0 breaks readthedocs builds.
4+
sphinx
55
sphinx_autodoc_typehints
66
sphinx_book_theme
77
sphinx-copybutton

notebooks/500_use_cases/501_dobot/501a_training_a_model_with_cubes_from_a_robotic_arm.ipynb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,45 @@
437437
")"
438438
]
439439
},
440+
{
441+
"cell_type": "markdown",
442+
"metadata": {},
443+
"source": [
444+
"For optimization and quantization process, we are using a seamless integration with [NNCF Library](https://github.com/openvinotoolkit/nncf) in the backend of Anomalib. Select one of the following options for optimization or quantization. Replace the openvino_model_path line above in order to export the optimized/quantized model:\n",
445+
"\n",
446+
"```\n",
447+
"# Exporting optimized/quantized models\n",
448+
"\n",
449+
"# Post Training Quantization\n",
450+
"openvino_model_path = engine.export(\n",
451+
" model, \n",
452+
" ExportType.OPENVINO, \n",
453+
" str(Path.cwd()) + \"_optimized\", \n",
454+
" compression_type=CompressionType.INT8_PTQ, \n",
455+
" datamodule=datamodule\n",
456+
" )\n",
457+
"\n",
458+
"# Accuracy-Control Quantization\n",
459+
"openvino_model_path=engine.export(\n",
460+
" model, \n",
461+
" ExportType.OPENVINO, \n",
462+
" str(Path.cwd()) + \"_optimized\", \n",
463+
" compression_type=CompressionType.INT8_ACQ, \n",
464+
" datamodule=datamodule, \n",
465+
" metric=\"F1Score\"\n",
466+
" )\n",
467+
"\n",
468+
"# Weight Compression\n",
469+
"openvino_model_path=engine.export(\n",
470+
" model, \n",
471+
" ExportType.OPENVINO, \n",
472+
" str(Path.cwd()) + \"_WEIGHTS\", \n",
473+
" compression_type=CompressionType.FP16, \n",
474+
" datamodule=datamodule\n",
475+
" )\n",
476+
"```"
477+
]
478+
},
440479
{
441480
"attachments": {},
442481
"cell_type": "markdown",

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ docs = [
6969
"myst-parser",
7070
"nbsphinx",
7171
"pandoc",
72-
"sphinx<8.0", # 7.0 breaks readthedocs builds.
72+
"sphinx",
7373
"sphinx_autodoc_typehints",
7474
"sphinx_book_theme",
7575
"sphinx-copybutton",
@@ -98,7 +98,7 @@ version = { attr = "anomalib.__version__" }
9898
# RUFF CONFIGURATION #
9999
[tool.ruff]
100100
# Enable rules
101-
select = [
101+
lint.select = [
102102
"F", # Pyflakes (`F`)
103103
"E", # pycodestyle error (`E`)
104104
"W", # pycodestyle warning (`W`)
@@ -149,7 +149,7 @@ select = [
149149
# "LOG", # flake8-logging (`LOG`) - ERROR: Unknown rule selector: `LOG`
150150
]
151151

152-
ignore = [
152+
lint.ignore = [
153153
# pydocstyle
154154
"D107", # Missing docstring in __init__
155155

@@ -179,8 +179,8 @@ ignore = [
179179
]
180180

181181
# Allow autofix for all enabled rules (when `--fix`) is provided.
182-
fixable = ["ALL"]
183-
unfixable = []
182+
lint.fixable = ["ALL"]
183+
lint.unfixable = []
184184

185185
# Exclude a variety of commonly ignored directories.
186186
exclude = [
@@ -210,20 +210,20 @@ exclude = [
210210
line-length = 120
211211

212212
# Allow unused variables when underscore-prefixed.
213-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
213+
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
214214

215215
# Assume Python 3.10.
216216
target-version = "py310"
217217

218218
# Allow imports relative to the "src" and "tests" directories.
219219
src = ["src", "tests"]
220220

221-
[tool.ruff.mccabe]
221+
[tool.ruff.lint.mccabe]
222222
# Unlike Flake8, default to a complexity level of 10.
223223
max-complexity = 15
224224

225225

226-
[tool.ruff.pydocstyle]
226+
[tool.ruff.lint.pydocstyle]
227227
convention = "google"
228228

229229

0 commit comments

Comments
 (0)