aimodelshare 0.1.12__py3-none-any.whl → 0.1.64__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aimodelshare might be problematic. Click here for more details.

Files changed (38) hide show
  1. aimodelshare/__init__.py +94 -14
  2. aimodelshare/aimsonnx.py +417 -262
  3. aimodelshare/api.py +7 -6
  4. aimodelshare/auth.py +163 -0
  5. aimodelshare/aws.py +4 -4
  6. aimodelshare/base_image.py +1 -1
  7. aimodelshare/containerisation.py +1 -1
  8. aimodelshare/data_sharing/download_data.py +145 -88
  9. aimodelshare/generatemodelapi.py +7 -6
  10. aimodelshare/main/eval_lambda.txt +81 -13
  11. aimodelshare/model.py +493 -197
  12. aimodelshare/modeluser.py +89 -1
  13. aimodelshare/moral_compass/README.md +408 -0
  14. aimodelshare/moral_compass/__init__.py +37 -0
  15. aimodelshare/moral_compass/_version.py +3 -0
  16. aimodelshare/moral_compass/api_client.py +601 -0
  17. aimodelshare/moral_compass/apps/__init__.py +26 -0
  18. aimodelshare/moral_compass/apps/ai_consequences.py +297 -0
  19. aimodelshare/moral_compass/apps/judge.py +299 -0
  20. aimodelshare/moral_compass/apps/tutorial.py +198 -0
  21. aimodelshare/moral_compass/apps/what_is_ai.py +426 -0
  22. aimodelshare/moral_compass/challenge.py +365 -0
  23. aimodelshare/moral_compass/config.py +187 -0
  24. aimodelshare/playground.py +26 -14
  25. aimodelshare/preprocessormodules.py +60 -6
  26. aimodelshare/reproducibility.py +20 -5
  27. aimodelshare/utils/__init__.py +78 -0
  28. aimodelshare/utils/optional_deps.py +38 -0
  29. aimodelshare-0.1.64.dist-info/METADATA +298 -0
  30. {aimodelshare-0.1.12.dist-info → aimodelshare-0.1.64.dist-info}/RECORD +33 -22
  31. {aimodelshare-0.1.12.dist-info → aimodelshare-0.1.64.dist-info}/WHEEL +1 -1
  32. aimodelshare-0.1.64.dist-info/licenses/LICENSE +5 -0
  33. {aimodelshare-0.1.12.dist-info → aimodelshare-0.1.64.dist-info}/top_level.txt +0 -1
  34. aimodelshare-0.1.12.dist-info/LICENSE +0 -22
  35. aimodelshare-0.1.12.dist-info/METADATA +0 -68
  36. tests/__init__.py +0 -0
  37. tests/test_aimsonnx.py +0 -135
  38. tests/test_playground.py +0 -721
@@ -1,22 +0,0 @@
1
-
2
- MIT License
3
-
4
- Copyright (c) 2023 AI Model Share Initiative (And all affiliated organizations and individuals)
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.
@@ -1,68 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: aimodelshare
3
- Version: 0.1.12
4
- Summary: Deploy locally saved machine learning models to a live rest API and web-dashboard. Share it with the world via modelshare.org
5
- Home-page: https://www.modelshare.org
6
- Author: Michael Parrott
7
- Author-email: mikedparrott@modelshare.org
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: Other/Proprietary License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.7
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: boto3 ==1.26.69
15
- Requires-Dist: botocore ==1.29.82
16
- Requires-Dist: scikit-learn ==1.2.2
17
- Requires-Dist: onnx ==1.13.1
18
- Requires-Dist: onnxconverter-common >=1.7.0
19
- Requires-Dist: regex
20
- Requires-Dist: keras2onnx >=1.7.0
21
- Requires-Dist: tensorflow >=2.12
22
- Requires-Dist: tf2onnx
23
- Requires-Dist: skl2onnx >=1.14.0
24
- Requires-Dist: onnxruntime >=1.7.0
25
- Requires-Dist: torch >=1.8.1
26
- Requires-Dist: pydot ==1.3.0
27
- Requires-Dist: importlib-resources ==5.10.0
28
- Requires-Dist: onnxmltools >=1.6.1
29
- Requires-Dist: Pympler ==0.9
30
- Requires-Dist: docker ==5.0.0
31
- Requires-Dist: wget ==3.2
32
- Requires-Dist: PyJWT >=2.4.0
33
- Requires-Dist: seaborn >=0.11.2
34
- Requires-Dist: astunparse ==1.6.3
35
- Requires-Dist: shortuuid >=1.0.8
36
- Requires-Dist: psutil >=5.9.1
37
- Requires-Dist: pathlib >=1.0.1
38
- Requires-Dist: protobuf >=3.20.1
39
- Requires-Dist: dill
40
- Requires-Dist: scikeras
41
-
42
-
43
- # aimodelshare
44
- ### The mission of the AI Model Share Platform (website w/ integrated Python library) is to provide a trusted non profit repository for machine learning model prediction APIs (python library + integrated website at modelshare.org. A beta version of the platform is currently being used by Columbia University students, faculty, and staff to test and improve platform functionality.
45
-
46
- ### In a matter of seconds, data scientists can launch a model into this infrastructure and end-users the world over will be able to engage their machine learning models.
47
-
48
- * ***Launch machine learning models into scalable production ready prediction REST APIs using a single Python function.***
49
-
50
- * ***Details about each model, how to use the model's API, and the model's author(s) are deployed simultaneously into a searchable website at modelshare.org.***
51
-
52
- * ***Deployed models receive an individual Model Playground listing information about all deployed models. Each of these pages includes a fully functional prediction dashboard that allows end-users to input text, tabular, or image data and receive live predictions.***
53
-
54
- * ***Moreover, users can build on model playgrounds by 1) creating ML model competitions, 2) uploading Jupyter notebooks to share code, 3) sharing model architectures and 4) sharing data... with all shared artifacts automatically creating a data science user portfolio.***
55
-
56
- # Use the aimodelshare Python library to deploy your model, create a new ML competition, and more.
57
- * [Tutorials for deploying models](https://www.modelshare.org/search/deploy?search=ALL&problemdomain=ALL&gettingstartedguide=TRUE&pythonlibrariesused=ALL&tags=ALL&pageNum=1).
58
-
59
- # Find model playground web-dashboards to generate predictions now.
60
- * [View deployed models and generate predictions at modelshare.org](https://www.modelshare.org)
61
-
62
- # Installation
63
-
64
- You can then install aimodelshare from PyPi
65
- ```
66
- pip install aimodelshare
67
- ```
68
-
tests/__init__.py DELETED
File without changes
tests/test_aimsonnx.py DELETED
@@ -1,135 +0,0 @@
1
- from aimodelshare.aimsonnx import _get_layer_names
2
- from aimodelshare.aimsonnx import _get_layer_names_pytorch
3
- from aimodelshare.aimsonnx import _get_sklearn_modules
4
- from aimodelshare.aimsonnx import model_from_string
5
- from aimodelshare.aimsonnx import _get_pyspark_modules
6
- from aimodelshare.aimsonnx import pyspark_model_from_string
7
- from aimodelshare.aimsonnx import layer_mapping
8
- from aimodelshare.aimsonnx import _sklearn_to_onnx
9
- from aimodelshare.aimsonnx import _pyspark_to_onnx
10
- from aimodelshare.aimsonnx import _keras_to_onnx
11
- from aimodelshare.aimsonnx import _pytorch_to_onnx
12
- from aimodelshare.aimsonnx import _misc_to_onnx
13
- from sklearn.linear_model import LogisticRegression
14
- from sklearn.neural_network import MLPClassifier
15
- import onnx
16
- from xgboost import XGBClassifier
17
- from pyspark.ml.classification import RandomForestClassifier, MultilayerPerceptronClassifier
18
- from keras.models import Sequential
19
- from torch import nn
20
- import torch
21
- from tensorflow.keras.layers import Dense
22
-
23
- def test_sklearn_to_onnx():
24
-
25
- from sklearn.datasets import load_iris
26
- data = load_iris()
27
- X = data.data
28
- y = data.target
29
-
30
- model = LogisticRegression(C=10, penalty='l1', solver='liblinear')
31
- model.fit(X, y)
32
- onnx_model = _sklearn_to_onnx(model)
33
- assert isinstance(onnx_model, onnx.ModelProto)
34
-
35
- # model = MLPClassifier()
36
- # model.fit(X, y)
37
- # onnx_model = _sklearn_to_onnx(model)
38
- # assert isinstance(onnx_model, onnx.ModelProto)
39
-
40
-
41
- # def test_misc_to_onnx():
42
- #
43
- # model = XGBClassifier()
44
- # onnx_model = _misc_to_onnx(model)
45
- # assert isinstance(onnx_model, onnx.ModelProto)
46
-
47
-
48
- # def test_pyspark_to_onnx():
49
- #
50
- # model =RandomForestClassifier(labelCol="indexedLabel", featuresCol="indexedFeatures", numTrees=10)
51
- # onnx_model = _pyspark_to_onnx(model)
52
- # assert isinstance(onnx_model, onnx.ModelProto)
53
- #
54
- # model = MultilayerPerceptronClassifier()
55
- # onnx_model = _pyspark_to_onnx(model)
56
- # assert isinstance(onnx_model, onnx.ModelProto)
57
-
58
- def test_keras_to_onnx():
59
-
60
- model = Sequential()
61
- model.add(Dense(12, input_shape=(8,), activation='relu'))
62
- model.add(Dense(8, activation='relu'))
63
- model.add(Dense(1, activation='sigmoid'))
64
- model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
65
-
66
- onnx_model = _keras_to_onnx(model)
67
- assert isinstance(onnx_model, onnx.ModelProto)
68
-
69
-
70
- def test_pytorch_to_onnx():
71
-
72
- model = nn.Sequential(nn.Linear(3, 3),
73
- nn.ReLU(),
74
- nn.Linear(3, 1),
75
- nn.Sigmoid())
76
-
77
- onnx_model = _pytorch_to_onnx(model, torch.randn(1, 3))
78
- assert isinstance(onnx_model, onnx.ModelProto)
79
-
80
-
81
- def test_get_layer_names():
82
-
83
- layers = _get_layer_names()
84
-
85
- assert isinstance(layers, tuple)
86
-
87
-
88
- def test_get_layer_names_pytorch():
89
-
90
- layers = _get_layer_names_pytorch()
91
-
92
- assert isinstance(layers, tuple)
93
-
94
-
95
- def test_get_sklearn_modules():
96
-
97
- modules = _get_sklearn_modules()
98
-
99
- assert isinstance(modules, dict)
100
-
101
- def test_model_from_string():
102
-
103
- model_class = model_from_string("RandomForestClassifier")
104
-
105
- assert model_class.__name__ == "RandomForestClassifier"
106
-
107
-
108
- def test_get_pyspark_modules():
109
-
110
- modules = _get_pyspark_modules()
111
-
112
- assert isinstance(modules, dict)
113
-
114
-
115
- def test_pyspark_model_from_string():
116
-
117
- model_class = pyspark_model_from_string("RandomForestClassifier")
118
-
119
- assert model_class.__name__ == "RandomForestClassifier"
120
-
121
-
122
- def test_layer_mapping():
123
-
124
- layer_map = layer_mapping(direction="torch_to_keras")
125
- assert isinstance(layer_map, dict)
126
-
127
- layer_map = layer_mapping(direction="keras_to_torch")
128
- assert isinstance(layer_map, dict)
129
-
130
- layer_map = layer_mapping(direction="torch_to_keras", activation=True)
131
- assert isinstance(layer_map, dict)
132
-
133
- layer_map = layer_mapping(direction="keras_to_torch", activation=True)
134
- assert isinstance(layer_map, dict)
135
-