-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathsetup.py
325 lines (239 loc) · 9.1 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# pylint: disable=C0321,C0103,C0301,E1305,E1121,C0302,C0330,C0111,W0613,W0611,R1705
# -*- coding: utf-8 -*-
"""
"""
import io
import os
import subprocess
import sys
from setuptools import find_packages, setup
######################################################################################
root = os.path.abspath(os.path.dirname(__file__))
##### check if GPU available #########################################################
p = subprocess.Popen(["command -v nvidia-smi"], stdout=subprocess.PIPE, shell=True)
out = p.communicate()[0].decode("utf8")
gpu_available = len(out) > 0
##### Version #######################################################################
version ='0.19.1'
print("version", version)
""""
with io.open(os.path.join(root, 'nlp_architect', 'version.py'), encoding='utf8') as f:
version_f = {}
exec(f.read(), version_f)
version = version_f['NLP_ARCHITECT_VERSION']
"""
######################################################################################
with open('requirements.txt') as fp:
install_requires = fp.read()
######################################################################################
with open("README.md", "r") as fh:
long_description = fh.read()
long_description = """
```
ml_models --do
"testall" : test all modules inside model_tf
"test" : test a certain module inside model_tf
"model_list" : #list all models in the repo
"fit" : wrap fit generic m ethod
"predict" : predict using a pre-trained model and some data
"generate_config" : generate config file from code source
ml_optim --do
"test" : Test the hyperparameter optimization for a specific model
"test_all" : TODO, Test all
"search" : search for the best hyperparameters of a specific model
Include models :
encoder_vanilla
bidirectional_vanilla
vanilla_2path
lstm_seq2seq
lstm_attention
lstm_seq2seq_attention
lstm_seq2seq_bidirectional
lstm_seq2seq_bidirectional_attention
lstm_attention_scaleddot
lstm_dilated
lstm.py models
only_attention
multihead_attention
lstm_bahdanau
lstm_luong
lstm_luong_bahdanau
dnc
lstm_residual
byte_net
attention_is_all_you_need
fairseq
encoder_lstm
bidirectional_lstm
lstm_2path
lstm attention
gru
encoder_gru
bidirectional_gru
gru_2path
vanilla
autoencoder
nbeats time series
deepar time series
```
"""
### Packages ####################################################
packages = ["mlmodels"] + ["mlmodels." + p for p in find_packages("mlmodels")]
### CLI Scripts #################################################
"""
scripts = [ "mlmodels/models.py",
"mlmodels/optim.py",
"mlmodels/cli_mlmodels",
]
"""
### CLI Scripts #################################################
entry_points={ 'console_scripts': [
'ml_models = mlmodels.models:main',
'ml_optim = mlmodels.optim:main',
'ml_test = mlmodels.ztest:main'
] }
##################################################################
setup(
name="mlmodels",
version=version,
description="Generic model API, Model Zoo in Tensorflow, Keras, Pytorch, Hyperparamter search",
keywords='Machine Learning Interface library',
author="Kevin Noel",
author_email="brookm291@gmail.com",
url="https://github.com/arita37/mlmodels",
install_requires=install_requires,
python_requires='>=3.6',
packages=packages,
entry_points= entry_points,
long_description=long_description,
long_description_content_type="text/markdown",
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: ' +
'Artificial Intelligence',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: ' +
'Python Modules',
'Topic :: Scientific/Engineering :: Information Analysis',
'Environment :: Console',
'Environment :: Web Environment',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
]
)
################################################################################
################################################################################
"""
https://packaging.python.org/tutorials/packaging-projects/
import io
import os
import subprocess
import sys
from setuptools import setup, find_packages
root = os.path.abspath(os.path.dirname(__file__))
# required packages for NLP Architect
with open('requirements.txt') as fp:
install_requirements = fp.readlines()
# check if GPU available
p = subprocess.Popen(['command -v nvidia-smi'], stdout=subprocess.PIPE, shell=True)
out = p.communicate()[0].decode('utf8')
gpu_available = len(out) > 0
# Tensorflow version (make sure CPU/MKL/GPU versions exist before changing)
for r in install_requirements:
if r.startswith('tensorflow=='):
tf_version = r.split('==')[1]
# default TF is CPU
chosen_tf = 'tensorflow=={}'.format(tf_version)
# check system is linux for MKL/GPU backends
if 'linux' in sys.platform:
system_type = 'linux'
tf_be = os.getenv('NLP_ARCHITECT_BE', False)
if tf_be and 'mkl' == tf_be.lower():
chosen_tf = 'intel-tensorflow=={}'.format(tf_version)
elif tf_be and 'gpu' == tf_be.lower() and gpu_available:
chosen_tf = 'tensorflow-gpu=={}'.format(tf_version)
for r in install_requirements:
if r.startswith('tensorflow=='):
install_requirements[install_requirements.index(r)] = chosen_tf
with open('README.md', encoding='utf8') as fp:
long_desc = fp.read()
with io.open(os.path.join(root, 'nlp_architect', 'version.py'), encoding='utf8') as f:
version_f = {}
exec(f.read(), version_f)
version = version_f['NLP_ARCHITECT_VERSION']
setup(name='nlp-architect',
version=version,
description='Intel AI Lab\'s open-source NLP and NLU research library',
long_description=long_desc,
long_description_content_type='text/markdown',
keywords='NLP NLU deep learning natural language processing tensorflow keras dynet',
author='Intel AI Lab',
packages=find_packages(exclude=['tests.*', 'tests', '*.tests', '*.tests.*',
'examples.*', 'examples', '*.examples', '*.examples.*']),
install_requires=install_requirements,
scripts=['nlp_architect/nlp_architect'],
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: ' +
'Artificial Intelligence',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: ' +
'Python Modules',
'Topic :: Scientific/Engineering :: Information Analysis',
'Environment :: Console',
'Environment :: Web Environment',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
]
)
import os
from io import open
from setuptools import find_packages, setup
packages = ['elfi'] + ['elfi.' + p for p in find_packages('elfi')]
# include C++ examples
package_data = {'elfi.examples': ['cpp/Makefile', 'cpp/*.txt', 'cpp/*.cpp']}
with open('requirements.txt', 'r') as f:
requirements = f.read().splitlines()
optionals = {'doc': ['Sphinx'], 'graphviz': ['graphviz>=0.7.1']}
# read version number
__version__ = open('elfi/__init__.py').readlines()[-1].split(' ')[-1].strip().strip("'\"")
setup(
name='elfi',
keywords='abc likelihood-free statistics',
packages=packages,
package_data=package_data,
version=__version__,
author='ELFI authors',
author_email='elfi-support@hiit.fi',
url='http://elfi.readthedocs.io',
install_requires=requirements,
extras_require=optionals,
description='ELFI - Engine for Likelihood-free Inference',
long_description=(open('docs/description.rst').read()),
license='BSD',
classifiers=[
'Programming Language :: Python :: 3.5', 'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Mathematics', 'Operating System :: OS Independent',
'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License'
],
zip_safe=False)
"""