2021-08-31 09:08:22 +00:00
# Copyright 2021 The HuggingFace Team. All rights reserved.
2020-12-07 23:36:34 +00:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2018-12-11 11:20:22 +00:00
"""
2022-03-23 07:46:59 +00:00
Simple check list from AllenNLP repo : https : / / github . com / allenai / allennlp / blob / main / setup . py
2018-12-11 11:20:22 +00:00
To create the package for pypi .
2021-03-16 12:41:47 +00:00
1. Run ` make pre - release ` ( or ` make pre - patch ` for a patch release ) then run ` make fix - copies ` to fix the index of the
documentation .
2022-05-10 15:22:42 +00:00
2022-04-28 18:17:44 +00:00
If releasing on a special branch , copy the updated README . md on the main branch for your the commit you will make
for the post - release and run ` make fix - copies ` on the main branch as well .
2021-04-08 20:13:17 +00:00
2021-03-30 06:28:02 +00:00
2. Run Tests for Amazon Sagemaker . The documentation is located in ` . / tests / sagemaker / README . md ` , otherwise @philschmid .
2018-12-11 11:20:22 +00:00
2021-03-30 06:28:02 +00:00
3. Unpin specific versions from setup . py that use a git install .
2020-05-07 18:15:20 +00:00
2022-06-02 16:14:21 +00:00
4. Checkout the release branch ( v < RELEASE > - release , for example v4 .19 - release ) , and commit these changes with the
2022-05-12 15:04:23 +00:00
message : " Release: <VERSION> " and push .
2018-12-11 11:20:22 +00:00
2022-03-23 07:46:59 +00:00
5. Wait for the tests on main to be completed and be green ( otherwise revert and fix bugs )
2021-11-03 21:45:41 +00:00
2021-12-22 19:39:44 +00:00
6. Add a tag in git to mark the release : " git tag v<VERSION> -m ' Adds tag v<VERSION> for pypi ' "
2022-05-12 15:04:23 +00:00
Push the tag to git : git push - - tags origin v < RELEASE > - release
2018-12-11 11:20:22 +00:00
2021-11-03 21:45:41 +00:00
7. Build both the sources and the wheel . Do not change anything in setup . py between
2018-12-11 11:20:22 +00:00
creating the wheel and the source distribution ( obviously ) .
2019-09-26 11:47:58 +00:00
For the wheel , run : " python setup.py bdist_wheel " in the top level directory .
2019-12-22 17:22:29 +00:00
( this will build a wheel for the python version you use to build it ) .
2018-12-11 11:20:22 +00:00
For the sources , run : " python setup.py sdist "
2019-09-26 11:47:58 +00:00
You should now have a / dist directory with both . whl and . tar . gz source versions .
2018-12-11 11:20:22 +00:00
2021-11-03 21:45:41 +00:00
8. Check that everything looks correct by uploading the package to the pypi test server :
2018-12-11 11:20:22 +00:00
twine upload dist / * - r pypitest
( pypi suggest using twine as other methods upload files via plaintext . )
2020-01-31 14:48:15 +00:00
You may have to specify the repository url , use the following command then :
twine upload dist / * - r pypitest - - repository - url = https : / / test . pypi . org / legacy /
2018-12-11 11:20:22 +00:00
Check that you can install it in a virtualenv by running :
2019-09-26 08:15:53 +00:00
pip install - i https : / / testpypi . python . org / pypi transformers
2018-12-11 11:20:22 +00:00
2021-11-03 21:45:41 +00:00
Check you can run the following commands :
2021-12-08 11:07:54 +00:00
python - c " from transformers import pipeline; classifier = pipeline( ' text-classification ' ); print(classifier( ' What a nice release ' )) "
2021-11-03 21:45:41 +00:00
python - c " from transformers import * "
9. Upload the final version to actual pypi :
2018-12-11 11:20:22 +00:00
twine upload dist / * - r pypi
2021-11-03 21:45:41 +00:00
10. Copy the release notes from RELEASE . md to the tag in github once everything is looking hunky - dory .
2018-12-11 11:20:22 +00:00
2022-06-02 11:44:03 +00:00
11. Run ` make post - release ` then run ` make fix - copies ` . If you were on a branch for the release ,
2022-03-23 07:46:59 +00:00
you need to go back to main before executing this .
2018-12-11 11:20:22 +00:00
"""
2019-12-21 14:57:32 +00:00
2020-10-27 17:54:57 +00:00
import os
2020-11-24 18:22:25 +00:00
import re
2019-12-23 19:06:39 +00:00
import shutil
2020-11-24 18:22:25 +00:00
from distutils . core import Command
2019-12-23 19:06:39 +00:00
from pathlib import Path
2018-11-15 19:56:10 +00:00
from setuptools import find_packages , setup
2021-12-30 16:30:58 +00:00
2019-12-23 19:06:39 +00:00
# Remove stale transformers.egg-info directory to avoid https://github.com/pypa/pip/issues/5466
stale_egg_info = Path ( __file__ ) . parent / " transformers.egg-info "
if stale_egg_info . exists ( ) :
print (
(
" Warning: {} exists. \n \n "
" If you recently updated transformers to 3.0 or later, this is expected, \n "
" but it may prevent transformers from installing in editable mode. \n \n "
" This directory is automatically generated by Python ' s packaging tools. \n "
" I will remove it now. \n \n "
" See https://github.com/pypa/pip/issues/5466 for details. \n "
) . format ( stale_egg_info )
)
shutil . rmtree ( stale_egg_info )
2020-11-24 18:22:25 +00:00
# IMPORTANT:
# 1. all dependencies should be listed here with their version requirements if any
# 2. once modified, run: `make deps_table_update` to update src/transformers/dependency_versions_table.py
_deps = [
2021-04-08 20:13:17 +00:00
" Pillow " ,
2022-06-17 17:59:35 +00:00
" accelerate>=0.10.0 " ,
2022-09-09 21:30:05 +00:00
" black==22.3 " , # after updating to black 2023, also update Python version in pyproject.toml to 3.7
2021-06-23 06:53:09 +00:00
" codecarbon==1.2.0 " ,
2022-03-24 15:08:31 +00:00
" cookiecutter==1.7.3 " ,
2020-11-24 18:22:25 +00:00
" dataclasses " ,
2022-09-21 13:37:53 +00:00
" datasets!=2.5.0 " ,
2022-12-08 21:22:43 +00:00
" decord==0.6.0 " ,
2022-06-02 16:14:21 +00:00
" deepspeed>=0.6.5 " ,
2022-05-20 15:00:58 +00:00
" dill<0.3.5 " ,
2022-08-01 15:14:49 +00:00
" evaluate>=0.2.0 " ,
2021-04-08 22:46:54 +00:00
" fairscale>0.3 " ,
2020-11-24 18:22:25 +00:00
" faiss-cpu " ,
" fastapi " ,
" filelock " ,
" flake8>=3.8.3 " ,
2022-07-05 14:17:17 +00:00
" flax>=0.4.1 " ,
2022-02-18 09:21:30 +00:00
" ftfy " ,
2020-11-24 18:22:25 +00:00
" fugashi>=1.0 " ,
2021-07-23 12:16:04 +00:00
" GitPython<3.1.19 " ,
2022-04-29 21:42:15 +00:00
" hf-doc-builder>=0.3.0 " ,
2023-01-18 16:14:00 +00:00
" huggingface-hub>=0.11.0,<1.0 " ,
2021-01-06 17:17:24 +00:00
" importlib_metadata " ,
2020-11-24 18:22:25 +00:00
" ipadic>=1.0.0,<2.0 " ,
" isort>=5.5.4 " ,
2022-04-17 01:15:19 +00:00
" jax>=0.2.8,!=0.3.2,<=0.3.6 " ,
" jaxlib>=0.1.65,<=0.3.6 " ,
2021-04-09 18:07:47 +00:00
" jieba " ,
2022-10-26 15:06:46 +00:00
" kenlm " ,
2022-11-29 15:02:40 +00:00
" keras-nlp>=0.3.1 " ,
2021-04-08 20:13:17 +00:00
" nltk " ,
2022-11-18 18:08:26 +00:00
" natten>=0.14.4 " ,
2021-02-02 10:46:33 +00:00
" numpy>=1.17 " ,
2020-09-01 12:27:52 +00:00
" onnxconverter-common " ,
2020-11-24 18:22:25 +00:00
" onnxruntime-tools>=1.4.2 " ,
" onnxruntime>=1.4.0 " ,
2021-05-28 11:52:01 +00:00
" optuna " ,
2021-06-23 12:13:32 +00:00
" optax>=0.0.8 " ,
2021-09-06 21:19:02 +00:00
" packaging>=20.0 " ,
2020-11-24 18:22:25 +00:00
" parameterized " ,
2021-12-17 18:56:44 +00:00
" phonemizer " ,
2022-10-03 21:37:09 +00:00
" protobuf<=3.20.2 " ,
2020-11-24 18:22:25 +00:00
" psutil " ,
2021-07-12 13:55:36 +00:00
" pyyaml>=5.1 " ,
2020-11-24 18:22:25 +00:00
" pydantic " ,
" pytest " ,
2021-07-13 19:13:18 +00:00
" pytest-timeout " ,
2020-11-24 18:22:25 +00:00
" pytest-xdist " ,
2022-05-12 15:04:23 +00:00
" python>=3.7.0 " ,
2021-06-24 08:13:17 +00:00
" ray[tune] " ,
2020-11-24 18:22:25 +00:00
" regex!=2019.12.17 " ,
" requests " ,
2022-05-04 08:04:10 +00:00
" rjieba " ,
2022-09-01 10:04:49 +00:00
" rouge-score!=0.0.7,!=0.0.8,!=0.1,!=0.1.1 " ,
2021-08-10 10:27:49 +00:00
" sacrebleu>=1.4.12,<2.0.0 " ,
2020-11-24 18:22:25 +00:00
" sacremoses " ,
2022-09-30 14:58:04 +00:00
" safetensors>=0.2.1 " ,
2021-04-08 20:13:17 +00:00
" sagemaker>=2.31.0 " ,
2020-11-24 18:22:25 +00:00
" scikit-learn " ,
2021-09-15 13:25:03 +00:00
" sentencepiece>=0.1.91,!=0.1.92 " ,
2021-09-23 15:01:51 +00:00
" sigopt " ,
2021-10-18 10:52:40 +00:00
" librosa " ,
2020-11-24 18:22:25 +00:00
" starlette " ,
2022-12-06 23:28:59 +00:00
" tensorflow-cpu>=2.4,<2.12 " ,
" tensorflow>=2.4,<2.12 " ,
2022-06-27 11:06:21 +00:00
" tensorflow-text " ,
2022-01-14 17:35:39 +00:00
" tf2onnx " ,
2020-11-24 18:22:25 +00:00
" timeout-decorator " ,
2021-06-09 15:51:13 +00:00
" timm " ,
2022-09-21 15:46:04 +00:00
" tokenizers>=0.11.1,!=0.11.3,<0.14 " ,
2022-11-15 16:33:09 +00:00
" torch>=1.7,!=1.12.0 " ,
2021-03-10 16:12:04 +00:00
" torchaudio " ,
2022-10-18 12:48:03 +00:00
" pyctcdecode>=0.4.0 " ,
2020-11-24 18:22:25 +00:00
" tqdm>=4.27 " ,
" unidic>=1.0.2 " ,
" unidic_lite>=1.0.7 " ,
" uvicorn " ,
2022-09-30 16:14:01 +00:00
" beautifulsoup4 " ,
2022-10-05 15:41:37 +00:00
" sudachipy>=0.6.6 " ,
" sudachidict_core>=20220729 " ,
2022-12-31 06:22:26 +00:00
" rhoknp>=1.1.0 " ,
2020-05-14 20:35:52 +00:00
]
2020-11-24 18:22:25 +00:00
2021-01-14 10:04:08 +00:00
# this is a lookup table with items like:
#
# tokenizers: "tokenizers==0.9.4"
# packaging: "packaging"
#
# some of the values are versioned whereas others aren't.
2022-09-21 14:15:31 +00:00
deps = { b : a for a , b in ( re . findall ( r " ^(([^!=<>~ ]+)(?:[!=<>~ ].*)?$) " , x ) [ 0 ] for x in _deps ) }
2020-11-24 18:22:25 +00:00
2021-01-14 10:04:08 +00:00
# since we save this data in src/transformers/dependency_versions_table.py it can be easily accessed from
# anywhere. If you need to quickly access the data from this table in a shell, you can do so easily with:
#
# python -c 'import sys; from transformers.dependency_versions_table import deps; \
# print(" ".join([ deps[x] for x in sys.argv[1:]]))' tokenizers datasets
#
# Just pass the desired package names to that script as it's shown with 2 packages above.
#
# If transformers is not yet installed and the work is done from the cloned repo remember to add `PYTHONPATH=src` to the script above
#
# You can then feed this for example to `pip`:
#
# pip install -U $(python -c 'import sys; from transformers.dependency_versions_table import deps; \
# print(" ".join([ deps[x] for x in sys.argv[1:]]))' tokenizers datasets)
#
2020-11-24 18:22:25 +00:00
def deps_list ( * pkgs ) :
return [ deps [ pkg ] for pkg in pkgs ]
class DepsTableUpdateCommand ( Command ) :
"""
A custom distutils command that updates the dependency table .
usage : python setup . py deps_table_update
"""
description = " build runtime dependency table "
user_options = [
# format: (long option, short option, description).
( " dep-table-update " , None , " updates src/transformers/dependency_versions_table.py " ) ,
]
def initialize_options ( self ) :
pass
def finalize_options ( self ) :
pass
def run ( self ) :
entries = " \n " . join ( [ f ' " { k } " : " { v } " , ' for k , v in deps . items ( ) ] )
content = [
" # THIS FILE HAS BEEN AUTOGENERATED. To update: " ,
" # 1. modify the `_deps` dict in setup.py " ,
" # 2. run `make deps_table_update`` " ,
" deps = { " ,
entries ,
" } " ,
2020-12-16 12:03:32 +00:00
" " ,
2020-11-24 18:22:25 +00:00
]
target = " src/transformers/dependency_versions_table.py "
print ( f " updating { target } " )
2020-11-27 17:25:20 +00:00
with open ( target , " w " , encoding = " utf-8 " , newline = " \n " ) as f :
2020-11-24 18:22:25 +00:00
f . write ( " \n " . join ( content ) )
extras = { }
2022-12-31 06:22:26 +00:00
extras [ " ja " ] = deps_list ( " fugashi " , " ipadic " , " unidic_lite " , " unidic " , " sudachipy " , " sudachidict_core " , " rhoknp " )
2020-11-24 18:22:25 +00:00
extras [ " sklearn " ] = deps_list ( " scikit-learn " )
2022-11-29 15:02:40 +00:00
extras [ " tf " ] = deps_list ( " tensorflow " , " onnxconverter-common " , " tf2onnx " , " tensorflow-text " , " keras-nlp " )
extras [ " tf-cpu " ] = deps_list ( " tensorflow-cpu " , " onnxconverter-common " , " tf2onnx " , " tensorflow-text " , " keras-nlp " )
2020-11-24 18:22:25 +00:00
extras [ " torch " ] = deps_list ( " torch " )
2022-06-17 17:59:35 +00:00
extras [ " accelerate " ] = deps_list ( " accelerate " )
2020-10-27 17:54:57 +00:00
if os . name == " nt " : # windows
2020-11-24 18:22:25 +00:00
extras [ " retrieval " ] = deps_list ( " datasets " ) # faiss is not supported on windows
extras [ " flax " ] = [ ] # jax is not supported on windows
2020-10-27 18:39:49 +00:00
else :
2020-11-24 18:22:25 +00:00
extras [ " retrieval " ] = deps_list ( " faiss-cpu " , " datasets " )
2021-06-23 12:13:32 +00:00
extras [ " flax " ] = deps_list ( " jax " , " jaxlib " , " flax " , " optax " )
2019-12-22 19:28:26 +00:00
2020-11-24 18:22:25 +00:00
extras [ " tokenizers " ] = deps_list ( " tokenizers " )
2022-02-18 09:21:30 +00:00
extras [ " ftfy " ] = deps_list ( " ftfy " )
2020-11-24 18:22:25 +00:00
extras [ " onnxruntime " ] = deps_list ( " onnxruntime " , " onnxruntime-tools " )
2022-01-14 17:35:39 +00:00
extras [ " onnx " ] = deps_list ( " onnxconverter-common " , " tf2onnx " ) + extras [ " onnxruntime " ]
2020-11-24 18:22:25 +00:00
extras [ " modelcreation " ] = deps_list ( " cookiecutter " )
2019-12-22 19:28:26 +00:00
2021-03-30 06:28:02 +00:00
extras [ " sagemaker " ] = deps_list ( " sagemaker " )
2022-06-17 17:59:35 +00:00
extras [ " deepspeed " ] = deps_list ( " deepspeed " ) + extras [ " accelerate " ]
2021-04-08 22:46:54 +00:00
extras [ " fairscale " ] = deps_list ( " fairscale " )
2021-05-28 11:52:01 +00:00
extras [ " optuna " ] = deps_list ( " optuna " )
2021-06-24 08:13:17 +00:00
extras [ " ray " ] = deps_list ( " ray[tune] " )
2021-09-23 15:01:51 +00:00
extras [ " sigopt " ] = deps_list ( " sigopt " )
2021-05-28 11:52:01 +00:00
2021-10-18 10:52:40 +00:00
extras [ " integrations " ] = extras [ " optuna " ] + extras [ " ray " ] + extras [ " sigopt " ]
2021-03-30 06:28:02 +00:00
2020-11-24 18:22:25 +00:00
extras [ " serving " ] = deps_list ( " pydantic " , " uvicorn " , " fastapi " , " starlette " )
2022-10-26 15:06:46 +00:00
extras [ " audio " ] = deps_list ( " librosa " , " pyctcdecode " , " phonemizer " , " kenlm " )
2021-12-30 16:30:58 +00:00
# `pip install ".[speech]"` is deprecated and `pip install ".[torch-speech]"` should be used instead
extras [ " speech " ] = deps_list ( " torchaudio " ) + extras [ " audio " ]
2021-08-31 09:08:22 +00:00
extras [ " torch-speech " ] = deps_list ( " torchaudio " ) + extras [ " audio " ]
extras [ " tf-speech " ] = extras [ " audio " ]
extras [ " flax-speech " ] = extras [ " audio " ]
2021-04-01 15:16:05 +00:00
extras [ " vision " ] = deps_list ( " Pillow " )
2021-06-09 15:51:13 +00:00
extras [ " timm " ] = deps_list ( " timm " )
2022-11-18 18:08:26 +00:00
extras [ " natten " ] = deps_list ( " natten " )
2021-06-23 06:53:09 +00:00
extras [ " codecarbon " ] = deps_list ( " codecarbon " )
2022-12-08 21:22:43 +00:00
extras [ " video " ] = deps_list ( " decord " )
2022-09-30 19:32:59 +00:00
2020-11-24 18:22:25 +00:00
extras [ " sentencepiece " ] = deps_list ( " sentencepiece " , " protobuf " )
extras [ " testing " ] = (
2021-03-30 06:28:02 +00:00
deps_list (
2021-12-30 16:30:58 +00:00
" pytest " ,
" pytest-xdist " ,
" timeout-decorator " ,
" parameterized " ,
" psutil " ,
" datasets " ,
2022-05-20 15:00:58 +00:00
" dill " ,
2022-08-01 12:55:44 +00:00
" evaluate " ,
2021-12-30 16:30:58 +00:00
" pytest-timeout " ,
" black " ,
" sacrebleu " ,
" rouge-score " ,
" nltk " ,
" GitPython " ,
2022-03-28 11:45:18 +00:00
" hf-doc-builder " ,
2022-06-17 17:59:35 +00:00
" protobuf " , # Can be removed once we can unpin protobuf
2022-05-04 08:04:10 +00:00
" sacremoses " ,
2022-06-17 17:59:35 +00:00
" rjieba " ,
2022-09-30 14:58:04 +00:00
" safetensors " ,
2022-09-30 16:14:01 +00:00
" beautifulsoup4 " ,
2021-03-30 06:28:02 +00:00
)
2020-11-24 18:22:25 +00:00
+ extras [ " retrieval " ]
+ extras [ " modelcreation " ]
)
2021-04-08 22:10:44 +00:00
2022-12-16 17:23:46 +00:00
extras [ " deepspeed-testing " ] = extras [ " deepspeed " ] + extras [ " testing " ] + extras [ " optuna " ] + extras [ " sentencepiece " ]
2022-04-15 00:24:38 +00:00
2022-09-14 18:06:49 +00:00
extras [ " quality " ] = deps_list ( " black " , " datasets " , " isort " , " flake8 " , " GitPython " , " hf-doc-builder " )
2020-10-27 17:54:57 +00:00
2021-04-06 12:56:18 +00:00
extras [ " all " ] = (
extras [ " tf " ]
+ extras [ " torch " ]
+ extras [ " flax " ]
+ extras [ " sentencepiece " ]
+ extras [ " tokenizers " ]
2021-08-31 09:08:22 +00:00
+ extras [ " torch-speech " ]
2021-04-06 12:56:18 +00:00
+ extras [ " vision " ]
2021-05-28 11:52:01 +00:00
+ extras [ " integrations " ]
2021-06-09 15:51:13 +00:00
+ extras [ " timm " ]
2021-06-23 06:53:09 +00:00
+ extras [ " codecarbon " ]
2022-06-17 17:59:35 +00:00
+ extras [ " accelerate " ]
2022-12-08 21:22:43 +00:00
+ extras [ " video " ]
2021-04-06 12:56:18 +00:00
)
2020-10-27 17:54:57 +00:00
2021-12-16 14:29:26 +00:00
# Might need to add doc-builder and some specific deps in the future
2022-03-28 11:45:18 +00:00
extras [ " docs_specific " ] = [ " hf-doc-builder " ]
2021-12-16 14:29:26 +00:00
2021-04-08 22:10:44 +00:00
# "docs" needs "all" to resolve all the references
extras [ " docs " ] = extras [ " all " ] + extras [ " docs_specific " ]
2022-03-01 13:55:11 +00:00
extras [ " dev-torch " ] = (
2022-06-17 17:59:35 +00:00
extras [ " testing " ]
+ extras [ " torch " ]
2022-03-01 13:55:11 +00:00
+ extras [ " sentencepiece " ]
+ extras [ " tokenizers " ]
+ extras [ " torch-speech " ]
+ extras [ " vision " ]
+ extras [ " integrations " ]
+ extras [ " timm " ]
+ extras [ " codecarbon " ]
+ extras [ " quality " ]
+ extras [ " ja " ]
+ extras [ " docs_specific " ]
+ extras [ " sklearn " ]
+ extras [ " modelcreation " ]
+ extras [ " onnxruntime " ]
)
extras [ " dev-tensorflow " ] = (
2022-06-17 17:59:35 +00:00
extras [ " testing " ]
+ extras [ " tf " ]
+ extras [ " sentencepiece " ]
+ extras [ " tokenizers " ]
+ extras [ " vision " ]
+ extras [ " quality " ]
+ extras [ " docs_specific " ]
+ extras [ " sklearn " ]
+ extras [ " modelcreation " ]
+ extras [ " onnx " ]
+ extras [ " tf-speech " ]
2022-03-01 13:55:11 +00:00
)
2020-11-24 18:22:25 +00:00
extras [ " dev " ] = (
extras [ " all " ]
+ extras [ " testing " ]
+ extras [ " quality " ]
+ extras [ " ja " ]
2021-04-08 22:10:44 +00:00
+ extras [ " docs_specific " ]
2020-11-24 18:22:25 +00:00
+ extras [ " sklearn " ]
+ extras [ " modelcreation " ]
)
2020-10-27 17:54:57 +00:00
2021-01-27 08:34:21 +00:00
extras [ " torchhub " ] = deps_list (
" filelock " ,
2021-04-21 23:17:29 +00:00
" huggingface-hub " ,
2021-01-27 08:34:21 +00:00
" importlib_metadata " ,
" numpy " ,
" packaging " ,
" protobuf " ,
" regex " ,
" requests " ,
" sentencepiece " ,
" torch " ,
" tokenizers " ,
" tqdm " ,
)
2019-12-04 05:52:23 +00:00
2020-11-24 18:22:25 +00:00
# when modifying the following list, make sure to update src/transformers/dependency_versions_check.py
install_requires = [
2021-01-06 17:17:24 +00:00
deps [ " importlib_metadata " ] + " ;python_version< ' 3.8 ' " , # importlib_metadata for Python versions that don't have it
2020-12-16 12:03:32 +00:00
deps [ " filelock " ] , # filesystem locks, e.g., to prevent parallel downloads
2021-04-21 23:12:58 +00:00
deps [ " huggingface-hub " ] ,
2020-11-24 18:22:25 +00:00
deps [ " numpy " ] ,
deps [ " packaging " ] , # utilities from PyPA to e.g., compare versions
2021-06-23 12:13:32 +00:00
deps [ " pyyaml " ] , # used for the model cards metadata
2020-12-16 12:03:32 +00:00
deps [ " regex " ] , # for OpenAI GPT
deps [ " requests " ] , # for downloading models over HTTPS
2021-01-12 23:00:22 +00:00
deps [ " tokenizers " ] ,
2020-12-16 12:03:32 +00:00
deps [ " tqdm " ] , # progress bars in model download and training scripts
2020-11-24 18:22:25 +00:00
]
2018-11-15 19:56:10 +00:00
setup (
2019-09-26 08:15:53 +00:00
name = " transformers " ,
2023-01-23 21:52:35 +00:00
version = " 4.27.0.dev0 " , # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
2022-05-02 16:58:17 +00:00
author = " The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors) " ,
author_email = " transformers@huggingface.co " ,
description = " State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow " ,
2019-12-21 14:46:46 +00:00
long_description = open ( " README.md " , " r " , encoding = " utf-8 " ) . read ( ) ,
2018-11-15 19:56:10 +00:00
long_description_content_type = " text/markdown " ,
2022-05-02 16:58:17 +00:00
keywords = " NLP vision speech deep learning transformer pytorch tensorflow BERT GPT-2 Wav2Vec2 ViT " ,
2019-12-21 14:46:46 +00:00
license = " Apache " ,
2019-09-26 08:15:53 +00:00
url = " https://github.com/huggingface/transformers " ,
2019-12-22 18:14:07 +00:00
package_dir = { " " : " src " } ,
2019-12-22 12:54:22 +00:00
packages = find_packages ( " src " ) ,
2023-01-30 16:19:30 +00:00
package_data = { " transformers " : [ " py.typed " , " *.cu " , " *.cpp " , " *.cuh " , " *.h " , " *.pyx " ] } ,
2021-08-13 08:12:59 +00:00
zip_safe = False ,
2019-12-21 14:46:46 +00:00
extras_require = extras ,
2020-10-09 16:13:22 +00:00
entry_points = { " console_scripts " : [ " transformers-cli=transformers.commands.transformers_cli:main " ] } ,
2022-05-02 16:58:17 +00:00
python_requires = " >=3.7.0 " ,
2020-11-24 18:22:25 +00:00
install_requires = install_requires ,
2018-11-15 19:56:10 +00:00
classifiers = [
2019-12-22 18:14:07 +00:00
" Development Status :: 5 - Production/Stable " ,
" Intended Audience :: Developers " ,
" Intended Audience :: Education " ,
2019-12-21 14:46:46 +00:00
" Intended Audience :: Science/Research " ,
" License :: OSI Approved :: Apache Software License " ,
2019-12-22 18:14:07 +00:00
" Operating System :: OS Independent " ,
2019-12-21 14:46:46 +00:00
" Programming Language :: Python :: 3 " ,
2019-12-22 18:14:07 +00:00
" Programming Language :: Python :: 3.7 " ,
2021-09-06 21:32:24 +00:00
" Programming Language :: Python :: 3.8 " ,
" Programming Language :: Python :: 3.9 " ,
2019-12-21 14:46:46 +00:00
" Topic :: Scientific/Engineering :: Artificial Intelligence " ,
2018-11-15 19:56:10 +00:00
] ,
2020-11-24 18:22:25 +00:00
cmdclass = { " deps_table_update " : DepsTableUpdateCommand } ,
2018-11-15 19:56:10 +00:00
)