Skip to content

Add databricks_automl to the conda env for arima and deepar #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions runtime/databricks/automl_runtime/forecast/deepar/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
from mlflow.utils.environment import _mlflow_conda_env

from databricks.automl_runtime.forecast.model import ForecastModel, mlflow_forecast_log_model
from databricks.automl_runtime import version

DEEPAR_CONDA_ENV = _mlflow_conda_env(
additional_pip_deps=[
f"gluonts[torch]=={gluonts.__version__}",
f"pandas=={pd.__version__}",
f"databricks-automl-runtime=={version.__version__}"
]
)

Expand Down
10 changes: 7 additions & 3 deletions runtime/databricks/automl_runtime/forecast/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ def mlflow_forecast_log_model(forecast_model: ForecastModel,
:param forecast_model: Forecast model wrapper
:param sample_input: sample input Dataframes for model inference
"""
# log the model without signature if infer_signature is failed.
# TODO: we should not be logging without a signature since it cannot be registered to UC then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a JIRA ticket number to TODO:

e.g. # TODO(ML-XXXXX): we should not be logging...

try:
signature = forecast_model.infer_signature(sample_input)
except Exception: # noqa
signature = None
mlflow.pyfunc.log_model("model", conda_env=forecast_model.model_env,
python_model=forecast_model, signature=signature)
mlflow.pyfunc.log_model(
artifact_path="model",
conda_env=forecast_model.model_env,
python_model=forecast_model,
signature=signature
)
2 changes: 2 additions & 0 deletions runtime/databricks/automl_runtime/forecast/pmdarima/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
from databricks.automl_runtime.forecast.model import ForecastModel, mlflow_forecast_log_model
from databricks.automl_runtime.forecast.utils import calculate_period_differences, is_frequency_consistency, \
make_future_dataframe, make_single_future_dataframe
from databricks.automl_runtime import version


ARIMA_CONDA_ENV = _mlflow_conda_env(
additional_pip_deps=[
f"pmdarima=={pmdarima.__version__}",
f"pandas=={pd.__version__}",
f"databricks-automl-runtime=={version.__version__}"
]
)

Expand Down
Loading