aimodelshare 0.1.21__py3-none-any.whl → 0.1.62__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 (35) hide show
  1. aimodelshare/__init__.py +94 -14
  2. aimodelshare/aimsonnx.py +417 -262
  3. aimodelshare/api.py +8 -7
  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 +17 -0
  18. aimodelshare/moral_compass/apps/tutorial.py +198 -0
  19. aimodelshare/moral_compass/challenge.py +365 -0
  20. aimodelshare/moral_compass/config.py +187 -0
  21. aimodelshare/playground.py +26 -14
  22. aimodelshare/preprocessormodules.py +60 -6
  23. aimodelshare/reproducibility.py +20 -5
  24. aimodelshare/utils/__init__.py +78 -0
  25. aimodelshare/utils/optional_deps.py +38 -0
  26. aimodelshare-0.1.62.dist-info/METADATA +298 -0
  27. {aimodelshare-0.1.21.dist-info → aimodelshare-0.1.62.dist-info}/RECORD +30 -22
  28. {aimodelshare-0.1.21.dist-info → aimodelshare-0.1.62.dist-info}/WHEEL +1 -1
  29. aimodelshare-0.1.62.dist-info/licenses/LICENSE +5 -0
  30. {aimodelshare-0.1.21.dist-info → aimodelshare-0.1.62.dist-info}/top_level.txt +0 -1
  31. aimodelshare-0.1.21.dist-info/LICENSE +0 -22
  32. aimodelshare-0.1.21.dist-info/METADATA +0 -68
  33. tests/__init__.py +0 -0
  34. tests/test_aimsonnx.py +0 -135
  35. tests/test_playground.py +0 -721
@@ -0,0 +1,298 @@
1
+ Metadata-Version: 2.4
2
+ Name: aimodelshare
3
+ Version: 0.1.62
4
+ Summary: Deploy locally saved machine learning models to a live REST API and integrated dashboard.
5
+ Author-email: Michael Parrott <mikedparrott@modelshare.ai>
6
+ License:
7
+ Proprietary License
8
+
9
+ Copyright (c) 2025 Model Share Labs,Inc. (And all affiliated organizations and individuals)
10
+
11
+
12
+ Keywords: machine-learning,deployment,api,onnx,tensorflow,pytorch
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: Other/Proprietary License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: numpy>=1.23.0
20
+ Requires-Dist: pandas>=1.5.0
21
+ Requires-Dist: requests
22
+ Requires-Dist: urllib3
23
+ Requires-Dist: boto3
24
+ Requires-Dist: onnx
25
+ Requires-Dist: onnxmltools
26
+ Requires-Dist: onnxruntime
27
+ Requires-Dist: skl2onnx
28
+ Requires-Dist: tf2onnx
29
+ Requires-Dist: scikit-learn>=1.2.0
30
+ Requires-Dist: scikeras
31
+ Requires-Dist: shortuuid
32
+ Requires-Dist: Pympler
33
+ Requires-Dist: wget
34
+ Requires-Dist: PyJWT[crypto]<3,>=2.8
35
+ Requires-Dist: pydot
36
+ Requires-Dist: regex
37
+ Requires-Dist: psutil
38
+ Requires-Dist: dill
39
+ Requires-Dist: IPython
40
+ Provides-Extra: visual
41
+ Requires-Dist: graphviz; extra == "visual"
42
+ Provides-Extra: tensorflow
43
+ Requires-Dist: tensorflow==2.19.0; extra == "tensorflow"
44
+ Requires-Dist: keras2onnx; extra == "tensorflow"
45
+ Provides-Extra: pytorch
46
+ Requires-Dist: torch; extra == "pytorch"
47
+ Provides-Extra: ui
48
+ Requires-Dist: gradio>=4.0.0; extra == "ui"
49
+ Provides-Extra: full
50
+ Requires-Dist: tensorflow==2.19.0; extra == "full"
51
+ Requires-Dist: keras2onnx; extra == "full"
52
+ Requires-Dist: torch; extra == "full"
53
+ Requires-Dist: graphviz; extra == "full"
54
+ Requires-Dist: gradio>=4.0.0; extra == "full"
55
+ Provides-Extra: test
56
+ Requires-Dist: pytest; extra == "test"
57
+ Requires-Dist: pytest-cov; extra == "test"
58
+ Dynamic: license-file
59
+
60
+ <p align="center"><img width="40%" src="docs/aimodshare_banner.jpg" /></p>
61
+
62
+ ### The mission of the AI Model Share Platform 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.
63
+
64
+ ### 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.
65
+
66
+ * ***Launch machine learning models into scalable production ready prediction REST APIs using a single Python function.***
67
+
68
+ * ***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.***
69
+
70
+ * ***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.***
71
+
72
+ * ***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.***
73
+
74
+ # Use aimodelshare Python library to deploy your model, create a new ML competition, and more.
75
+ * [Tutorials for deploying models](https://www.modelshare.org/search/deploy?search=ALL&problemdomain=ALL&gettingstartedguide=TRUE&pythonlibrariesused=ALL&tags=ALL&pageNum=1).
76
+
77
+ # Find model playground web-dashboards to generate predictions now.
78
+ * [View deployed models and generate predictions at modelshare.org](https://www.modelshare.org)
79
+
80
+ # Installation
81
+
82
+ ## Install using PyPi
83
+
84
+ ```
85
+ pip install aimodelshare
86
+ ```
87
+
88
+ ## Install on Anaconda
89
+
90
+
91
+ #### Conda/Mamba Install ( For Mac and Linux Users Only , Windows Users should use pip method ) :
92
+
93
+ Make sure you have conda version >=4.9
94
+
95
+ You can check your conda version with:
96
+
97
+ ```
98
+ conda --version
99
+ ```
100
+
101
+ To update conda use:
102
+
103
+ ```
104
+ conda update conda
105
+ ```
106
+
107
+ Installing `aimodelshare` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with:
108
+
109
+ ```
110
+ conda config --add channels conda-forge
111
+ conda config --set channel_priority strict
112
+ ```
113
+
114
+ Once the `conda-forge` channel has been enabled, `aimodelshare` can be installed with `conda`:
115
+
116
+ ```
117
+ conda install aimodelshare
118
+ ```
119
+
120
+ or with `mamba`:
121
+
122
+ ```
123
+ mamba install aimodelshare
124
+ ```
125
+
126
+ # Moral Compass: Dynamic Metric Support for AI Ethics Challenges
127
+
128
+ The Moral Compass system now supports tracking multiple performance metrics for fairness-focused AI challenges. Track accuracy, demographic parity, equal opportunity, and other fairness metrics simultaneously.
129
+
130
+ ## Quick Start with Multi-Metric Tracking
131
+
132
+ ```python
133
+ from aimodelshare.moral_compass import ChallengeManager
134
+
135
+ # Create a challenge manager
136
+ manager = ChallengeManager(
137
+ table_id="fairness-challenge-2024",
138
+ username="your_username"
139
+ )
140
+
141
+ # Track multiple metrics
142
+ manager.set_metric("accuracy", 0.85, primary=True)
143
+ manager.set_metric("demographic_parity", 0.92)
144
+ manager.set_metric("equal_opportunity", 0.88)
145
+
146
+ # Track progress
147
+ manager.set_progress(tasks_completed=3, total_tasks=5)
148
+
149
+ # Sync to leaderboard
150
+ result = manager.sync()
151
+ print(f"Moral compass score: {result['moralCompassScore']:.4f}")
152
+ ```
153
+
154
+ ## Moral Compass Score Formula
155
+
156
+ ```
157
+ moralCompassScore = primaryMetricValue × ((tasksCompleted + questionsCorrect) / (totalTasks + totalQuestions))
158
+ ```
159
+
160
+ This combines:
161
+ - **Performance**: Your primary metric value (e.g., fairness score)
162
+ - **Progress**: Your completion rate across tasks and questions
163
+
164
+ ## Features
165
+
166
+ - **Multiple Metrics**: Track accuracy, fairness, robustness, and custom metrics
167
+ - **Primary Metric Selection**: Choose which metric drives leaderboard ranking
168
+ - **Progress Tracking**: Monitor task and question completion
169
+ - **Automatic Scoring**: Server-side computation of moral compass scores
170
+ - **Leaderboard Sorting**: Automatic ranking by moral compass score
171
+ - **Backward Compatible**: Existing users without metrics continue to work
172
+
173
+ ## Example: Justice & Equity Challenge
174
+
175
+ See [Justice & Equity Challenge Example](docs/justice_equity_challenge_example.md) for detailed examples including:
176
+ - Multi-metric fairness tracking
177
+ - Progressive challenge completion
178
+ - Leaderboard queries
179
+ - Custom fairness criteria
180
+
181
+ ## API Methods
182
+
183
+ ### ChallengeManager
184
+
185
+ ```python
186
+ from aimodelshare.moral_compass import ChallengeManager
187
+
188
+ manager = ChallengeManager(table_id="my-table", username="user1")
189
+
190
+ # Set metrics
191
+ manager.set_metric("accuracy", 0.90, primary=True)
192
+ manager.set_metric("fairness", 0.95)
193
+
194
+ # Set progress
195
+ manager.set_progress(tasks_completed=4, total_tasks=5)
196
+
197
+ # Preview score locally
198
+ score = manager.get_local_score()
199
+
200
+ # Sync to server
201
+ result = manager.sync()
202
+ ```
203
+
204
+ ### API Client
205
+
206
+ ```python
207
+ from aimodelshare.moral_compass import MoralcompassApiClient
208
+
209
+ client = MoralcompassApiClient()
210
+
211
+ # Update moral compass with metrics
212
+ result = client.update_moral_compass(
213
+ table_id="my-table",
214
+ username="user1",
215
+ metrics={"accuracy": 0.90, "fairness": 0.95},
216
+ primary_metric="fairness",
217
+ tasks_completed=4,
218
+ total_tasks=5
219
+ )
220
+ ```
221
+
222
+ ## Documentation
223
+
224
+ - [Full API Documentation](aimodelshare/moral_compass/README.md)
225
+ - [Justice & Equity Challenge Examples](docs/justice_equity_challenge_example.md)
226
+ - [Integration Tests](tests/test_moral_compass_client_minimal.py)
227
+
228
+ ## Moral Compass API URL Configuration
229
+
230
+ The Moral Compass API client requires a base URL to connect to the REST API. The URL is resolved in the following order:
231
+
232
+ ### For CI/CD Environments
233
+
234
+ In GitHub Actions workflows, the `MORAL_COMPASS_API_BASE_URL` environment variable is automatically exported from Terraform outputs:
235
+
236
+ ```yaml
237
+ - name: Initialize Terraform and get API URL
238
+ working-directory: infra
239
+ run: |
240
+ terraform init
241
+ terraform workspace select dev || terraform workspace new dev
242
+ API_URL=$(terraform output -raw api_base_url)
243
+ echo "MORAL_COMPASS_API_BASE_URL=$API_URL" >> $GITHUB_ENV
244
+ ```
245
+
246
+ ### For Local Development
247
+
248
+ When developing locally, the API client attempts to resolve the URL in this order:
249
+
250
+ 1. **Environment variable** - Set `MORAL_COMPASS_API_BASE_URL` or `AIMODELSHARE_API_BASE_URL`:
251
+ ```bash
252
+ export MORAL_COMPASS_API_BASE_URL="https://api.example.com/v1"
253
+ ```
254
+
255
+ 2. **Cached Terraform outputs** - The client looks for `infra/terraform_outputs.json`
256
+
257
+ 3. **Terraform command** - As a fallback, executes `terraform output -raw api_base_url` in the `infra/` directory
258
+
259
+ ### Graceful Test Skipping
260
+
261
+ Integration tests that require the Moral Compass API will skip gracefully if the URL cannot be resolved, rather than failing. This allows the test suite to run in environments where the infrastructure is not available (e.g., forks without access to AWS resources).
262
+
263
+ # Resource Cleanup
264
+
265
+ During testing, aimodelshare creates AWS resources including API Gateway REST APIs (playgrounds) and IAM users. To manage and clean up these resources:
266
+
267
+ ## Cleanup Script
268
+
269
+ Use the interactive cleanup script to identify and delete test resources:
270
+
271
+ ```bash
272
+ # Preview resources without deleting (safe)
273
+ python scripts/cleanup_test_resources.py --dry-run
274
+
275
+ # Interactive cleanup
276
+ python scripts/cleanup_test_resources.py
277
+
278
+ # Cleanup in a specific region
279
+ python scripts/cleanup_test_resources.py --region us-west-2
280
+ ```
281
+
282
+ The script will:
283
+ - List all API Gateway REST APIs (playgrounds) in the region
284
+ - List IAM users created by the test framework (prefix: `temporaryaccessAImodelshare`)
285
+ - Show associated resources (policies, access keys)
286
+ - Allow you to select which resources to delete
287
+ - Safely delete selected resources with proper cleanup order
288
+
289
+ ## GitHub Action
290
+
291
+ You can also trigger the cleanup workflow from the GitHub Actions tab:
292
+
293
+ 1. Go to **Actions** → **Cleanup Test Resources**
294
+ 2. Click **Run workflow**
295
+ 3. Select **dry-run** mode to preview resources
296
+ 4. Review the output and run locally to delete resources
297
+
298
+ For complete documentation, see [CLEANUP_RESOURCES.md](CLEANUP_RESOURCES.md).
@@ -1,25 +1,26 @@
1
1
  aimodelshare/README.md,sha256=_OMdUIeIYZnpFlKdafM1KNWaANO2nWdx0QpLE_ZC-Qs,2014
2
- aimodelshare/__init__.py,sha256=CS0iFxgAic21gBcQE6NSZ-D_ElHw80_A3OWrEYo9Dks,539
3
- aimodelshare/aimsonnx.py,sha256=bHjp2iEBSGKzfScDX4wn9I7lR2wPSMpdgi8qmroz4nY,69282
4
- aimodelshare/api.py,sha256=HcVXGJF9O9cysZWvbFSTgC0o62Y90jh7ddmRlB4rCP4,34920
5
- aimodelshare/aws.py,sha256=jn99R9-N77Qac-_eYm-LaCQUPd-RnE7oVULm9rh-3RY,15232
2
+ aimodelshare/__init__.py,sha256=csP3KFDIvloTtRqqGh7Jg1eo0Q6-V63VQbgYR2zzWZs,3228
3
+ aimodelshare/aimsonnx.py,sha256=NCjRd535kTfJ6zSEa2o9QpC-TqHPIiDNuS0yHcAQzx8,77178
4
+ aimodelshare/api.py,sha256=3AuTS88M-6zXye3eCjjaAnHpdvLjHHdYMyPZJm9O0Cc,35107
5
+ aimodelshare/auth.py,sha256=7FatqYMDF3x2u9GRuNm-2lvMMLKO1AHtWRxzu36ZVqE,4774
6
+ aimodelshare/aws.py,sha256=GSFw1Flc-hIyAk3a_0CtlKTOlhUBSeMF0tcRIweOHbI,15234
6
7
  aimodelshare/aws_client.py,sha256=Ce19iwf69BwpuyyJlVN8z1da3c5jf93svsTgx1OWhaA,6784
7
- aimodelshare/base_image.py,sha256=GVH3CH-iMdwtkydMcexxAahbYTc3_yJq-Gk0QNHXcGg,4826
8
+ aimodelshare/base_image.py,sha256=itaQmX_q5GmgQrL3VNCBJpDGhl4PGA-nLTCbuyNDCCc,4825
8
9
  aimodelshare/bucketpolicy.py,sha256=KLyl-BLBiFdTYzCK7tJV8NBJHBKWRlF3_msSTGwgaQQ,3055
9
- aimodelshare/containerisation.py,sha256=PkZIZD2p9pgloBG3b2Q9wA1yofoDEfWJoaxyUhB7gUs,8759
10
+ aimodelshare/containerisation.py,sha256=SaiO92wcdCwi8_C31AXNvaCdmZLnOB-7KTyP68-TQpM,8758
10
11
  aimodelshare/containerization.py,sha256=Sa9GWxmz1qoDZ3lUQjFa1ctQUSs666I7-Yf0YU3We1U,29609
11
12
  aimodelshare/custom_eval_metrics.py,sha256=NghFslmLDyvIkZ27yZhFIItLbzHnNb0bJ2ZO7cqkucw,3170
12
13
  aimodelshare/deploy_custom_lambda.py,sha256=HFxxIYI2JrZwPrjqKgFkj6KaCeRBOn6tf9e2fqBUl2U,11045
13
14
  aimodelshare/exceptions.py,sha256=gfrwQ7LHNyjgUNHM4X_LNZ7JhKwZv9qWN3DhBaB-f-k,318
14
- aimodelshare/generatemodelapi.py,sha256=KNIWd8_g7auZi-UC-dCVmazGHJQvs9_68aGaUS47i0E,59901
15
+ aimodelshare/generatemodelapi.py,sha256=lfJQs93gu_WYrUPmbXrb0Whe3cABLtvA5cXpqq2gs8A,59701
15
16
  aimodelshare/leaderboard.py,sha256=xtKJcNCsZjy2IoK1fUTAFyM_I-eLCMS1WJRfwgsT5AA,5216
16
- aimodelshare/model.py,sha256=03TPnazX2s-6wjkzYl1sSpvzLOmpYW5k_2cIHZGmPgg,49899
17
- aimodelshare/modeluser.py,sha256=kW1zG4lFcwA0-ZLEyYaD8diJOF8PVhB-RGpPZQB07V4,4311
18
- aimodelshare/playground.py,sha256=0qRaJ8pn5e2uDrWqdsue199sTfYgYkfi19A29oGahO4,88713
17
+ aimodelshare/model.py,sha256=_W7479wJxzsguDBKhmaNZyAtuSHiNI_fF6EZAOtbL8w,62311
18
+ aimodelshare/modeluser.py,sha256=uZJjwaT7zHBEcfttl6JYxvDdabKl36YdgvSjRa-gF8E,7512
19
+ aimodelshare/playground.py,sha256=jOMls-mv_A8W8AOM8ZCpSci63UauciMxPH5VwHclLN0,89273
19
20
  aimodelshare/postprocessormodules.py,sha256=L87fM2mywlInOrgaMETi-7zdHBGbIMRcrXKttQthyQ4,4992
20
- aimodelshare/preprocessormodules.py,sha256=ujkIdGWeMEyyc6eTaZi9kZRpfP-JEGzse89fL80ShHY,10912
21
+ aimodelshare/preprocessormodules.py,sha256=48HIur55nytD0FdhW1u1wWSAiaIW4uof0cJP1Yoq0T4,13183
21
22
  aimodelshare/readme.md,sha256=_OMdUIeIYZnpFlKdafM1KNWaANO2nWdx0QpLE_ZC-Qs,2014
22
- aimodelshare/reproducibility.py,sha256=4Eckx2_WELQkRMvnePJ68alGrvxlXTubbCVLz8Zzof8,5793
23
+ aimodelshare/reproducibility.py,sha256=5uN_2deZeFWyupR5uXnhu2RUQefXTSt9W0bsLJ86VPc,6227
23
24
  aimodelshare/tools.py,sha256=e9nRv_1H06nIum6BW2gyI0EF3GGkQ7-gPrppEPiq5C0,3109
24
25
  aimodelshare/utils.py,sha256=8vZ6hx-CGliVxXe_ed_viV_ZPGQVi4SSMRFfD71N1vs,1336
25
26
  aimodelshare/color_mappings/color_mapping_keras.csv,sha256=dOJjZ9TGE7EbCPg6rW_r4Ysv45bskH77fXakfDmGKuM,2728
@@ -31,7 +32,7 @@ aimodelshare/containerization_templates/lambda_function.txt,sha256=nEFoPDXemNcQZ
31
32
  aimodelshare/custom_approach/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
32
33
  aimodelshare/custom_approach/lambda_function.py,sha256=d1HZlgviHZq4mNBKx4q-RCunDK8P8i9DKZcfv6Nmgzc,479
33
34
  aimodelshare/data_sharing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- aimodelshare/data_sharing/download_data.py,sha256=difmxSdzUmNTKF4V2UmpzIL0KXeaw5gFOVbWkKz_Fiw,22799
35
+ aimodelshare/data_sharing/download_data.py,sha256=xJ6ylVO_oAiS72ue5iy2eOFol5Bnc7ZI8-OW0TC9sIw,25317
35
36
  aimodelshare/data_sharing/share_data.py,sha256=dMOP0-PTSpviOeHi3Nvj-uiq5PlIfk_SN5nN92j4PnI,13964
36
37
  aimodelshare/data_sharing/utils.py,sha256=865lN8-oGFi_U_zRaNnGB8Bd0sC8dN_iI5krZOSt_Ts,236
37
38
  aimodelshare/data_sharing/data_sharing_templates/Dockerfile.txt,sha256=27wmp7b0rXqJQsumhPxCvGHmUcDiiVgrC6i7DmY7KQA,77
@@ -107,10 +108,18 @@ aimodelshare/main/8.txt,sha256=MfcEQe9Gv6RSmWL3kd7oYkRkdDdkN4bPxEG43QVs7ms,4513
107
108
  aimodelshare/main/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
108
109
  aimodelshare/main/authorization.txt,sha256=lBWFZ1pyNuYFSEEWQbfEAZFDspcVE1guzlfpES7HNxk,10942
109
110
  aimodelshare/main/eval_classification.txt,sha256=gCBU71rbXRlkBwefVN3WhwVJX9fXh6bwOCa7ofLMdnA,3081
110
- aimodelshare/main/eval_lambda.txt,sha256=FZirZ_jrIdJQ90sChz30oBikUJG4eCVqlYg3z4MRS8o,60314
111
+ aimodelshare/main/eval_lambda.txt,sha256=r3GqJodO5QG6jeK4xWUzLrXM9K7XLXeUJouhz6efQbA,62831
111
112
  aimodelshare/main/eval_regression.txt,sha256=iQeE9mbOkg-BDF9TnoQmglo86jBJitJQCvaf1eELzrs,3111
112
113
  aimodelshare/main/lambda_function.txt,sha256=-XkuD2YUOWNryNT7rBPjlts588UAeE949TUqeVGCRlQ,150
113
114
  aimodelshare/main/nst.txt,sha256=8kTsR18kDEcaQbv6091XDq1tRiqqFxdqfCteslR_udk,4941
115
+ aimodelshare/moral_compass/README.md,sha256=2wTCI0s43Tm9WXRIJjtj6h-FFHsdHhzx-Aimy_UupBY,11888
116
+ aimodelshare/moral_compass/__init__.py,sha256=JG0-WFfZ5T5uylkZVLk9LseyeKGoBZQYjOmZOlgP8aA,973
117
+ aimodelshare/moral_compass/_version.py,sha256=GhviEK9nfN1o9XunS8V4jXqgMmcB-Vpp2VCYWplLzqE,80
118
+ aimodelshare/moral_compass/api_client.py,sha256=3WVWBuuEJ9x0R6raUu6TKZPv2swgVxCDwKXKg8Esq24,22393
119
+ aimodelshare/moral_compass/challenge.py,sha256=p--uqP30tPQnVcOPs4LEJFaXlqTRL9Zb7SVkEvggl2U,12971
120
+ aimodelshare/moral_compass/config.py,sha256=8HsoTreAAdXaWOdg30B1IJXwIGMBNEz7hqgNZpAFUhI,6119
121
+ aimodelshare/moral_compass/apps/__init__.py,sha256=0-0jxADtWzZh5BKcGLiTVmB4pxmlDW7o2iNhlYaZqis,553
122
+ aimodelshare/moral_compass/apps/tutorial.py,sha256=zNaQJM04VqUSaFBofR8rvb6tws3vPwqhztt5KYvi8ck,8042
114
123
  aimodelshare/placeholders/model.onnx,sha256=i04ndsRw5VBTOpIH-LHqTjAPHcJZNzyWSSz1zSmukBw,3464
115
124
  aimodelshare/placeholders/preprocessor.zip,sha256=463dahdrgzYzFY338r_be7xptPm_Z1kNgu52SMsFVAU,2930
116
125
  aimodelshare/pyspark/1.txt,sha256=FQYyw5s8bnrDFIl6kzqXZ6qGuh-N68SN4mRL561vjto,6529
@@ -140,11 +149,10 @@ aimodelshare/sam/codepipeline_policies.txt,sha256=267HMXMnbP7qRASkmFZYSx-2HmKf5o
140
149
  aimodelshare/sam/codepipeline_trust_relationship.txt,sha256=yfPYvZlN3fnaIHs7I3ENMMveigIE89mufV9pvR8EQH8,245
141
150
  aimodelshare/sam/spark-class.txt,sha256=chyJBxDzCzlUKXzVQYTzuJ2PXCTwg8_gd1yfnI-xbRw,217
142
151
  aimodelshare/sam/template.txt,sha256=JKSvEOZNaaLalHSx7r9psJg_6LLCb0XLAYi1-jYPu3M,1195
143
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
- tests/test_aimsonnx.py,sha256=-GOF1_qXGQaMxHyqK0GPg7dD1meE-S7CZea4pLmBDTk,3906
145
- tests/test_playground.py,sha256=vdFWPRrZNQ2poiBOoN3l7HsXB5yc3p3rrrclNYJHnaw,24574
146
- aimodelshare-0.1.21.dist-info/LICENSE,sha256=JXBYLriXYgTloZs-9CJPZY76dqkuDT5df_HghMnljx8,1134
147
- aimodelshare-0.1.21.dist-info/METADATA,sha256=GSvQ6-zPudwf6ssoDScoagWNkjNgDXxEz23uJNuE6x8,3304
148
- aimodelshare-0.1.21.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
149
- aimodelshare-0.1.21.dist-info/top_level.txt,sha256=2KJgeHQ0BmZuilB75J203i7W4vri6CON2kdbwk9BNpU,19
150
- aimodelshare-0.1.21.dist-info/RECORD,,
152
+ aimodelshare/utils/__init__.py,sha256=6ieChHjYDsn_gSyeOiLeWW5hWkUfZUucEzSFyBN7xck,1973
153
+ aimodelshare/utils/optional_deps.py,sha256=t0ZcPlaAKEQqBpD-GDbFGg9a-qp2fsqonTVM0dLWNV4,1257
154
+ aimodelshare-0.1.62.dist-info/licenses/LICENSE,sha256=XdPthYienQee9LH1duXNGtsj6GUTXPvtf_1MpC8WhL4,115
155
+ aimodelshare-0.1.62.dist-info/METADATA,sha256=xweffm625vxtT1Qo_ul2d0-_bf_o8fx3i_PtSx5yLQo,10077
156
+ aimodelshare-0.1.62.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
157
+ aimodelshare-0.1.62.dist-info/top_level.txt,sha256=d-0DAtZDZsvfauQzUjXHJRKVYfaqMWZXz3WGmmIzE5w,13
158
+ aimodelshare-0.1.62.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,5 @@
1
+
2
+ Proprietary License
3
+
4
+ Copyright (c) 2025 Model Share Labs,Inc. (And all affiliated organizations and individuals)
5
+
@@ -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.21
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
-