Skip to content

Commit 567d474

Browse files
committed
Setup package
1 parent bc1f079 commit 567d474

File tree

7 files changed

+228
-0
lines changed

7 files changed

+228
-0
lines changed

MANIFEST.in

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2021 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
include README.md
16+
include LICENSE

Makefile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2021 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
.PHONY: style test
16+
17+
# Run code quality checks
18+
style_check:
19+
black --check .
20+
isort --check .
21+
22+
style:
23+
black .
24+
isort .
25+
26+
# Run tests for the library
27+
test:
28+
python -m pytest tests
29+
30+
# Utilities to release to PyPi
31+
build_dist_install_tools:
32+
pip install build
33+
pip install twine
34+
35+
build_dist:
36+
rm -fr build
37+
rm -fr dist
38+
python -m build
39+
40+
pypi_upload: build_dist
41+
python -m twine upload dist/*

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Optimum Intel
2+
3+
🤗 Optimum Intel is the interface between the 🤗 Transformers library and the different tools and libraries provided by Intel to accelerate end-to-end pipelines on Intel architectures.
4+
5+
## Install
6+
To install the latest release of this package:
7+
8+
`pip install optimum[intel]`
9+
10+
Optimum Intel is a fast-moving project, and you may want to install from source.
11+
12+
`pip install git+https://github.com/huggingface/optimum-intel.git`
13+
14+
15+
## Running the examples
16+
17+
There are a number of examples provided in the `examples` directory.
18+
19+
Please install the requirements for every example:
20+
21+
```
22+
cd <example-folder>
23+
pip install -r requirements.txt
24+
```

optimum/version.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2022 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
__version__ = "1.2.1.dev0"

pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2022 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
[tool.black]
16+
line-length = 119
17+
target-version = ['py35']

setup.cfg

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[isort]
2+
default_section = FIRSTPARTY
3+
ensure_newline_before_comments = True
4+
force_grid_wrap = 0
5+
include_trailing_comma = True
6+
known_first_party = optimum
7+
known_third_party =
8+
absl
9+
conllu
10+
datasets
11+
elasticsearch
12+
fairseq
13+
faiss-cpu
14+
fastprogress
15+
fire
16+
fugashi
17+
git
18+
h5py
19+
matplotlib
20+
nltk
21+
numpy
22+
packaging
23+
pandas
24+
PIL
25+
psutil
26+
pytest
27+
pytorch_lightning
28+
rouge_score
29+
sacrebleu
30+
seqeval
31+
sklearn
32+
streamlit
33+
tensorboardX
34+
tensorflow
35+
tensorflow_datasets
36+
timeout_decorator
37+
torch
38+
torchaudio
39+
torchtext
40+
torchvision
41+
torch_xla
42+
tqdm
43+
transformers
44+
45+
line_length = 119
46+
lines_after_imports = 2
47+
multi_line_output = 3
48+
use_parentheses = True
49+
50+
[flake8]
51+
ignore = E203, E501, E741, W503, W605
52+
max-line-length = 119
53+
54+
[tool:pytest]
55+
doctest_optionflags=NUMBER NORMALIZE_WHITESPACE ELLIPSIS

setup.py

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import re
2+
3+
from setuptools import find_namespace_packages, setup
4+
5+
6+
# Ensure we match the version set in optimum/intel/version.py
7+
try:
8+
filepath = "optimum/intel/version.py"
9+
with open(filepath) as version_file:
10+
(__version__,) = re.findall('__version__ = "(.*)"', version_file.read())
11+
except Exception as error:
12+
assert False, "Error: Could not open '%s' due %s\n" % (filepath, error)
13+
14+
INSTALL_REQUIRES = [
15+
"optimum",
16+
"transformers",
17+
"datasets",
18+
"torch",
19+
"sentencepiece",
20+
"scipy",
21+
"neural_compressor",
22+
]
23+
24+
TESTS_REQUIRE = ["pytest", "parameterized"]
25+
26+
EXTRAS_REQUIRE = {
27+
"tests": TESTS_REQUIRE,
28+
}
29+
30+
setup(
31+
name="optimum-intel",
32+
version=__version__,
33+
description="Optimum Library is an extension of the Hugging Face Transformers library, providing a framework to "
34+
"integrate third-party libraries from Hardware Partners and interface with their specific "
35+
"functionality.",
36+
long_description=open("README.md", "r", encoding="utf-8").read(),
37+
long_description_content_type="text/markdown",
38+
classifiers=[
39+
"Development Status :: 5 - Production/Stable",
40+
"License :: OSI Approved :: Apache Software License",
41+
"Intended Audience :: Developers",
42+
"Intended Audience :: Education",
43+
"Intended Audience :: Science/Research",
44+
"Operating System :: OS Independent",
45+
"Programming Language :: Python :: 3.7",
46+
"Programming Language :: Python :: 3.8",
47+
"Programming Language :: Python :: 3.9",
48+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
49+
],
50+
keywords="transformers, quantization, pruning, knowledge distillation, optimization, training",
51+
url="https://www.intel.com",
52+
author="HuggingFace Inc. Special Ops Team",
53+
author_email="hardware@huggingface.co",
54+
license="Apache",
55+
packages=find_namespace_packages(include=["optimum*"]),
56+
install_requires=INSTALL_REQUIRES,
57+
extras_require=EXTRAS_REQUIRE,
58+
include_package_data=True,
59+
zip_safe=False,
60+
)

0 commit comments

Comments
 (0)