Skip to content

Commit 6e438c5

Browse files
authored
Release modelstore==0.0.80 (#270)
* Release 0.0.80 * Add URL * Update requirements * Disable hdfs tests in examples * Refresh gcloud * Only import storage when required * Format code * Downgrade requirememnts * Check alternative tokenizer file name * Remove f-strings * Run isort * Exclude yolov5 in azure * Remove test (does not work with import inside function) * Fix name * Add free-disk-space action step * Fix name change in latest shap library
1 parent 437fd38 commit 6e438c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+162
-143
lines changed

.github/workflows/unit-tests.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ jobs:
1818
uses: actions/setup-python@v4
1919
with:
2020
python-version: ${{ matrix.python-version }}
21+
- name: Free Disk Space (Ubuntu)
22+
uses: jlumbroso/free-disk-space@main
23+
with:
24+
# this might remove tools that are actually needed,
25+
# if set to "true" but frees about 6 GB
26+
tool-cache: false
27+
28+
# all of these default to true, but feel free to set to
29+
# "false" if necessary for your workflow
30+
android: true
31+
dotnet: true
32+
haskell: true
33+
large-packages: true
34+
docker-images: true
35+
swap-storage: true
2136
- name: Install dependencies
2237
run: |
2338
python -m pip install --upgrade pip setuptools wheel
@@ -27,4 +42,4 @@ jobs:
2742
pip install -e .
2843
- name: Test with pytest
2944
run: |
30-
pytest
45+
pytest -x

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
multi_line_output = 3

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change log
22

3-
## Unreleased
3+
## modelstore 0.0.80 ([October 2023](https://github.com/operatorai/modelstore/pull/270))
44

55
**🆕 New functionality**
66

examples/Makefile-example

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
VIRTUALENV_NAME=modelstore.$(shell pwd | rev | cut -d '/' -f 1 | rev)
22
REPO_ROOT=$(shell cd ../../ && pwd)
33

4-
.PHONY: name pyenv pyenv-local pyenv-prod pyenv-test pyenv-uninstall refresh
4+
.PHONY: name pyenv pyenv-local pyenv-prod pyenv-test pyenv-uninstall refresh gcloud
55

66
name:
77
@echo $(VIRTUALENV_NAME)
88

99
pyenv-uninstall:
1010
@$(REPO_ROOT)/bin/_pyenv_uninstall $(VIRTUALENV_NAME)
1111

12+
gcloud:
13+
@gcloud components update
14+
@gcloud auth application-default login
15+
1216
pyenv: pyenv-uninstall
13-
#@$(REPO_ROOT)/bin/_setup_brew
17+
# @$(REPO_ROOT)/bin/_setup_brew
1418
@$(REPO_ROOT)/bin/_pyenv_install $(VIRTUALENV_NAME)
1519
pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt
1620

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
multi_line_output = 3

examples/examples-by-ml-library/libraries/huggingface/distilbert.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer
15+
from transformers import (
16+
AutoConfig,
17+
AutoModelForSequenceClassification,
18+
AutoTokenizer
19+
)
1620

1721
from modelstore.model_store import ModelStore
1822

examples/examples-by-ml-library/libraries/huggingface/dpt.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
# limitations under the License.
1414
from typing import Tuple
1515

16-
from transformers import DPTForDepthEstimation, DPTImageProcessor, DPTPreTrainedModel
16+
from transformers import (
17+
DPTForDepthEstimation,
18+
DPTImageProcessor,
19+
DPTPreTrainedModel
20+
)
1721

1822
from modelstore.model_store import ModelStore
1923

examples/examples-by-ml-library/libraries/onnx_lightgbm_example.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
from libraries.util.datasets import load_classification_dataset
1818
from libraries.util.domains import BREAST_CANCER_DOMAIN
1919
from lightgbm import LGBMClassifier
20-
from onnxmltools.convert.lightgbm.operator_converters.LightGbm import convert_lightgbm
20+
from onnxmltools.convert.lightgbm.operator_converters.LightGbm import (
21+
convert_lightgbm
22+
)
2123
from onnxruntime import InferenceSession
2224
from skl2onnx import convert_sklearn, update_registered_converter
2325
from skl2onnx.common.data_types import FloatTensorType
24-
from skl2onnx.common.shape_calculator import calculate_linear_classifier_output_shapes
26+
from skl2onnx.common.shape_calculator import (
27+
calculate_linear_classifier_output_shapes
28+
)
2529
from sklearn.metrics import mean_squared_error
2630

2731
from modelstore.model_store import ModelStore
@@ -30,11 +34,11 @@
3034
def _train_example_model() -> onnx.ModelProto:
3135
X_train, X_test, y_train, y_test = load_classification_dataset()
3236

33-
print(f"🔍 Training a light gbm classifier")
37+
print("🔍 Training a light gbm classifier")
3438
clf = LGBMClassifier(random_state=12)
3539
clf.fit(X_train, y_train)
3640

37-
print(f"🔍 Converting the model to onnx")
41+
print("🔍 Converting the model to onnx")
3842
update_registered_converter(
3943
LGBMClassifier,
4044
"LightGbmLGBMClassifier",
@@ -50,7 +54,7 @@ def _train_example_model() -> onnx.ModelProto:
5054
target_opset={"": 12, "ai.onnx.ml": 2},
5155
)
5256

53-
print(f"🔍 Loading the onnx model as an inference session")
57+
print("🔍 Loading the onnx model as an inference session")
5458
sess = InferenceSession(model.SerializeToString())
5559
y_pred = sess.run(None, {"X": X_test.astype(np.float32)})[0]
5660

examples/examples-by-ml-library/libraries/util/datasets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
# limitations under the License.
1414
import pandas as pd
1515
import torch
16-
from sklearn.datasets import fetch_20newsgroups, load_breast_cancer, load_diabetes
16+
from sklearn.datasets import (
17+
fetch_20newsgroups,
18+
load_breast_cancer,
19+
load_diabetes
20+
)
1721
from sklearn.model_selection import train_test_split
1822

1923

examples/examples-by-ml-library/main.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@
3737
tensorflow_example,
3838
xgboost_booster_example,
3939
xgboost_example,
40-
yolo_example,
40+
yolo_example
41+
)
42+
from libraries.huggingface import (
43+
distilbert,
44+
dpt,
45+
gpt2_pytorch,
46+
gpt2_tensorflow,
47+
sam
4148
)
42-
from libraries.huggingface import distilbert, dpt, gpt2_pytorch, gpt2_tensorflow, sam
4349
from modelstores import MODELSTORES, create_model_store
4450

4551
EXAMPLES = {
@@ -93,6 +99,10 @@ def main(modelstore_in, ml_framework):
9399
if sys.platform == "darwin" and ml_framework == "fastai":
94100
print(f"⏩ Skipping {ml_framework} on darwin.")
95101
return
102+
if ml_framework == "yolov5" and modelstore_in == "azure-container":
103+
# Upload time out bug
104+
print(f"⏩ Skipping {ml_framework} in {modelstore_in}.")
105+
return
96106
print(
97107
f"\n🆕 Running {ml_framework} modelstore example with {modelstore_in} backend."
98108
)

0 commit comments

Comments
 (0)