Skip to content

Commit

Permalink
Automatically generated by github-worflow[bot] for commit: c4c558e (#387
Browse files Browse the repository at this point in the history
)
  • Loading branch information
iguazio-cicd authored Oct 10, 2024
1 parent 179545d commit 2c80085
Show file tree
Hide file tree
Showing 16 changed files with 479 additions and 165 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
### Change log [2024-10-10 07:25:57]
1. Item Updated: `sklearn_classifier` (from version: `1.1.1` to `1.1.1`)
2. Item Updated: `noise_reduction` (from version: `1.0.0` to `1.0.0`)
3. Item Updated: `auto_trainer` (from version: `1.7.0` to `1.7.0`)
4. Item Updated: `batch_inference_v2` (from version: `2.6.0` to `2.6.0`)
5. Item Updated: `open_archive` (from version: `1.1.0` to `1.1.0`)
6. Item Updated: `v2_model_server` (from version: `1.2.0` to `1.2.0`)
7. Item Updated: `model_server` (from version: `1.1.0` to `1.1.0`)
8. Item Updated: `question_answering` (from version: `0.4.0` to `0.4.0`)
9. Item Updated: `feature_selection` (from version: `1.5.0` to `1.5.0`)
10. Item Updated: `validate_great_expectations` (from version: `1.1.0` to `1.1.0`)
11. Item Updated: `arc_to_parquet` (from version: `1.4.1` to `1.4.1`)
12. Item Updated: `mlflow_utils` (from version: `1.0.0` to `1.0.0`)
13. Item Updated: `batch_inference` (from version: `1.7.0` to `1.7.0`)
14. Item Updated: `model_server_tester` (from version: `1.1.0` to `1.1.0`)
15. Item Updated: `pyannote_audio` (from version: `1.2.0` to `1.2.0`)
16. Item Updated: `hugging_face_serving` (from version: `1.1.0` to `1.1.0`)
17. Item Updated: `azureml_serving` (from version: `1.1.0` to `1.1.0`)
18. Item Updated: `azureml_utils` (from version: `1.3.0` to `1.3.0`)
19. Item Updated: `v2_model_tester` (from version: `1.1.0` to `1.1.0`)
20. Item Updated: `describe_dask` (from version: `1.1.0` to `1.1.0`)
21. Item Updated: `text_to_audio_generator` (from version: `1.2.0` to `1.2.0`)
22. Item Updated: `translate` (from version: `0.1.0` to `0.1.0`)
23. Item Updated: `sklearn_classifier_dask` (from version: `1.1.1` to `1.1.1`)
24. Item Updated: `gen_class_data` (from version: `1.2.0` to `1.2.0`)
25. Item Updated: `structured_data_generator` (from version: `1.5.0` to `1.5.0`)
26. Item Updated: `transcribe` (from version: `1.1.0` to `1.1.0`)
27. Item Updated: `model_monitoring_batch` (from version: `1.1.0` to `1.1.0`)
28. Item Updated: `describe` (from version: `1.3.0` to `1.3.0`)
29. Item Updated: `pii_recognizer` (from version: `0.3.0` to `0.3.0`)
30. Item Updated: `silero_vad` (from version: `1.3.0` to `1.3.0`)
31. Item Updated: `describe_spark` (from version: `1.1.0` to `1.1.0`)
32. Item Updated: `github_utils` (from version: `1.1.0` to `1.1.0`)
33. Item Updated: `send_email` (from version: `1.2.0` to `1.2.0`)
34. Item Updated: `onnx_utils` (from version: `1.2.0` to `1.2.0`)
35. Item Updated: `load_dataset` (from version: `1.2.0` to `1.2.0`)
36. Item Updated: `test_classifier` (from version: `1.1.0` to `1.1.0`)
37. Item Updated: `aggregate` (from version: `1.3.0` to `1.3.0`)
38. Item Updated: `tf2_serving` (from version: `1.1.0` to `1.1.0`)

### Change log [2024-10-09 07:18:31]
1. Item Updated: `sklearn_classifier` (from version: `1.1.1` to `1.1.1`)
2. Item Updated: `noise_reduction` (from version: `1.0.0` to `1.0.0`)
Expand Down
2 changes: 1 addition & 1 deletion catalog.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,17 @@ def infer(
model_endpoint_sample_set: Union[
mlrun.DataItem, list, dict, pd.DataFrame, pd.Series, np.ndarray
] = None,

# the following parameters are deprecated and will be removed once the versioning mechanism is implemented
# TODO: Remove the following parameters once FHUB-13 is resolved
trigger_monitoring_job: Optional[bool] = None,
batch_image_job: Optional[str] = None,
model_endpoint_drift_threshold: Optional[float] = None,
model_endpoint_possible_drift_threshold: Optional[float] = None,

# prediction kwargs to pass to the model predict function
**predict_kwargs: Dict[str, Any],

):
"""
Perform a prediction on the provided dataset using the specified model.
Expand Down Expand Up @@ -173,10 +183,33 @@ def infer(
:param model_endpoint_sample_set: A sample dataset to give to compare the inputs in the drift analysis.
Can be provided as an input (DataItem) or as a parameter (e.g. string, list, DataFrame).
The default chosen sample set will always be the one who is set in the model artifact itself.
:param trigger_monitoring_job: Whether to trigger the batch drift analysis after the infer job.
:param batch_image_job: The image that will be used to register the monitoring batch job if not exist.
By default, the image is mlrun/mlrun.
:param model_endpoint_drift_threshold: The threshold of which to mark drifts. Defaulted to 0.7.
:param model_endpoint_possible_drift_threshold: The threshold of which to mark possible drifts. Defaulted to 0.5.
raises MLRunInvalidArgumentError: if both `model_path` and `endpoint_id` are not provided
"""


if trigger_monitoring_job:
context.logger.warning("The `trigger_monitoring_job` parameter is deprecated and will be removed once the versioning mechanism is implemented. "
"if you are using mlrun<1.7.0, please import the previous version of this function, for example "
"'hub://batch_inference_v2:2.5.0'.")
if batch_image_job:
context.logger.warning("The `batch_image_job` parameter is deprecated and will be removed once the versioning mechanism is implemented. "
"if you are using mlrun<1.7.0, please import the previous version of this function, for example "
"'hub://batch_inference_v2:2.5.0'.")
if model_endpoint_drift_threshold:
context.logger.warning("The `model_endpoint_drift_threshold` parameter is deprecated and will be removed once the versioning mechanism is implemented. "
"if you are using mlrun<1.7.0, please import the previous version of this function, for example "
"'hub://batch_inference_v2:2.5.0'.")
if model_endpoint_possible_drift_threshold:
context.logger.warning("The `model_endpoint_possible_drift_threshold` parameter is deprecated and will be removed once the versioning mechanism is implemented. "
"if you are using mlrun<1.7.0, please import the previous version of this function, for example "
"'hub://batch_inference_v2:2.5.0'.")

# Loading the model:
context.logger.info(f"Loading model...")
if isinstance(model_path, mlrun.DataItem):
Expand Down Expand Up @@ -250,4 +283,4 @@ def infer(
model_endpoint_name=model_endpoint_name,
infer_results_df=result_set.copy(),
sample_set_statistics=sample_set_statistics,
)
)
95 changes: 56 additions & 39 deletions functions/development/batch_inference_v2/2.6.0/src/function.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,17 @@ <h1>Source code for batch_inference_v2.batch_inference_v2</h1><div class="highli
<span class="n">model_endpoint_sample_set</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span>
<span class="n">mlrun</span><span class="o">.</span><span class="n">DataItem</span><span class="p">,</span> <span class="nb">list</span><span class="p">,</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span>
<span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>

<span class="c1"># the following parameters are deprecated and will be removed once the versioning mechanism is implemented</span>
<span class="c1"># TODO: Remove the following parameters once FHUB-13 is resolved</span>
<span class="n">trigger_monitoring_job</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">batch_image_job</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">model_endpoint_drift_threshold</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">model_endpoint_possible_drift_threshold</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>

<span class="c1"># prediction kwargs to pass to the model predict function</span>
<span class="o">**</span><span class="n">predict_kwargs</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">],</span>

<span class="p">):</span>
<span class="w"> </span><span class="sd">"""</span>
<span class="sd"> Perform a prediction on the provided dataset using the specified model.</span>
Expand Down Expand Up @@ -289,10 +299,33 @@ <h1>Source code for batch_inference_v2.batch_inference_v2</h1><div class="highli
<span class="sd"> :param model_endpoint_sample_set: A sample dataset to give to compare the inputs in the drift analysis.</span>
<span class="sd"> Can be provided as an input (DataItem) or as a parameter (e.g. string, list, DataFrame).</span>
<span class="sd"> The default chosen sample set will always be the one who is set in the model artifact itself.</span>
<span class="sd"> :param trigger_monitoring_job: Whether to trigger the batch drift analysis after the infer job.</span>
<span class="sd"> :param batch_image_job: The image that will be used to register the monitoring batch job if not exist.</span>
<span class="sd"> By default, the image is mlrun/mlrun.</span>
<span class="sd"> :param model_endpoint_drift_threshold: The threshold of which to mark drifts. Defaulted to 0.7.</span>
<span class="sd"> :param model_endpoint_possible_drift_threshold: The threshold of which to mark possible drifts. Defaulted to 0.5.</span>

<span class="sd"> raises MLRunInvalidArgumentError: if both `model_path` and `endpoint_id` are not provided</span>
<span class="sd"> """</span>


<span class="k">if</span> <span class="n">trigger_monitoring_job</span><span class="p">:</span>
<span class="n">context</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"The `trigger_monitoring_job` parameter is deprecated and will be removed once the versioning mechanism is implemented. "</span>
<span class="s2">"if you are using mlrun&lt;1.7.0, please import the previous version of this function, for example "</span>
<span class="s2">"'hub://batch_inference_v2:2.5.0'."</span><span class="p">)</span>
<span class="k">if</span> <span class="n">batch_image_job</span><span class="p">:</span>
<span class="n">context</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"The `batch_image_job` parameter is deprecated and will be removed once the versioning mechanism is implemented. "</span>
<span class="s2">"if you are using mlrun&lt;1.7.0, please import the previous version of this function, for example "</span>
<span class="s2">"'hub://batch_inference_v2:2.5.0'."</span><span class="p">)</span>
<span class="k">if</span> <span class="n">model_endpoint_drift_threshold</span><span class="p">:</span>
<span class="n">context</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"The `model_endpoint_drift_threshold` parameter is deprecated and will be removed once the versioning mechanism is implemented. "</span>
<span class="s2">"if you are using mlrun&lt;1.7.0, please import the previous version of this function, for example "</span>
<span class="s2">"'hub://batch_inference_v2:2.5.0'."</span><span class="p">)</span>
<span class="k">if</span> <span class="n">model_endpoint_possible_drift_threshold</span><span class="p">:</span>
<span class="n">context</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"The `model_endpoint_possible_drift_threshold` parameter is deprecated and will be removed once the versioning mechanism is implemented. "</span>
<span class="s2">"if you are using mlrun&lt;1.7.0, please import the previous version of this function, for example "</span>
<span class="s2">"'hub://batch_inference_v2:2.5.0'."</span><span class="p">)</span>

<span class="c1"># Loading the model:</span>
<span class="n">context</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Loading model..."</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">model_path</span><span class="p">,</span> <span class="n">mlrun</span><span class="o">.</span><span class="n">DataItem</span><span class="p">):</span>
Expand Down
Loading

0 comments on commit 2c80085

Please sign in to comment.