Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: |
pip install --upgrade pip uv
uv pip install git+https://github.com/huggingface/doc-builder
uv pip install .[quality] nncf openvino neural-compressor[pt]>3.4 diffusers accelerate
uv pip install .[quality] nncf openvino neural-compressor[pt]>3.4 diffusers accelerate datasets
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed for neural-compressor reference section


- name: Make documentation
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
pip install --upgrade pip uv
uv pip install git+https://github.com/huggingface/doc-builder
uv pip install .[quality] nncf openvino neural-compressor[pt]>3.4 diffusers accelerate
uv pip install .[quality] nncf openvino neural-compressor[pt]>3.4 diffusers accelerate datasets

- name: Make documentation
shell: bash
Expand Down
11 changes: 9 additions & 2 deletions optimum/intel/openvino/quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union

import datasets
import nncf
import numpy as np
import openvino
Expand Down Expand Up @@ -360,7 +359,15 @@ def build_from_quantization_config(self, config: OVQuantizationConfigBase) -> OV
streaming=dataset_metadata["streaming"],
)
elif isinstance(config.dataset, list) and all(isinstance(it, str) for it in config.dataset):
dataset = datasets.Dataset.from_list([{"text": it} for it in config.dataset])
if not is_datasets_available():
raise ValueError(
DATASETS_IMPORT_ERROR.format("OVCalibrationDatasetBuilder.build_from_quantization_config")
)

from datasets import Dataset

dataset = Dataset.from_list([{"text": it} for it in config.dataset])

else:
raise ValueError(
"Please provide dataset as one of the accepted dataset labels or as a list of strings."
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
"torch>=2.1",
"optimum-onnx==0.0.*",
"transformers>=4.45,<4.56",
"datasets>=1.4.0",
"setuptools",
"scipy",
]

TESTS_REQUIRE = [
Expand Down Expand Up @@ -68,7 +66,7 @@
EXTRAS_REQUIRE = {
"nncf": ["nncf>=2.18.0"],
"openvino": ["nncf>=2.18.0", "openvino>=2025.1.0", "openvino-tokenizers>=2025.1.0"],
"neural-compressor": ["neural-compressor[pt]>=3.4.1", "accelerate", "transformers<4.46"],
"neural-compressor": ["neural-compressor[pt]>=3.4.1", "accelerate", "transformers<4.46", "datasets"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ipex": ["intel-extension-for-pytorch>=2.8", "transformers>4.54,<4.56", "accelerate"],
"diffusers": ["diffusers"],
"quality": QUALITY_REQUIRE,
Expand Down
Loading