Skip to content

Commit

Permalink
Update mldesigner component env style (Azure#1954)
Browse files Browse the repository at this point in the history
* update component env style

* rename and update env yaml
  • Loading branch information
zhengfeiwang committed Dec 2, 2022
1 parent 9321a3f commit bce5e18
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,11 @@ def train_model(
(Path(model_output) / "model").write_text(model)


# init customer environment with conda YAML
# the YAML file shall be put under your code folder.
conda_env = dict(
# note that mldesigner package must be included.
conda_file=Path(__file__).parent / "conda.yaml",
image="mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04",
)


@command_component(
display_name="Score",
environment=conda_env,
# init customer environment with conda YAML
# the YAML file shall be put under your code folder.
environment="./env.yaml",
# specify your code folder, default code folder is current file's parent
# code='.'
)
Expand Down Expand Up @@ -79,7 +72,7 @@ def score_data(
(Path(score_output) / "score").write_text("scored with {}".format(model))


@command_component(display_name="Evaluate", environment=conda_env)
@command_component(display_name="Evaluate", environment="./env.yaml")
def eval_model(
scoring_result: Input(type="uri_folder"), eval_output: Output(type="uri_folder")
):
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

image: mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04
name: mldesigner_environment
conda_file:
name: default_environment
channels:
- defaults
dependencies:
- python=3.8.12
- pip=21.2.2
- pip:
- mldesigner==0.1.0b4

0 comments on commit bce5e18

Please sign in to comment.