content: #  Copyright (c) ZenML GmbH 2022. All Rights Reserved.
  #
  #  Licensed under the Apache License, Version 2.0 (the "License");
  #  you may not use this file except in compliance with the License.
  #  You may obtain a copy of the License at:
  #
  #       https://www.apache.org/licenses/LICENSE-2.0
  #
  #  Unless required by applicable law or agreed to in writing, software
  #  distributed under the License is distributed on an "AS IS" BASIS,
  #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  #  or implied. See the License for the specific language governing
  #  permissions and limitations under the License.
  import click
  from constants import MODEL_NAME, PIPELINE_NAME, PIPELINE_STEP_NAME
  from pipelines.inference_fashion_mnist import inference_fashion_mnist
  from pipelines.training_fashion_mnist import training_fashion_mnist
  
  DEPLOY = "deploy"
  PREDICT = "predict"
  DEPLOY_AND_PREDICT = "deploy_and_predict"
  
  
  @click.command()
  @click.option(
      "--config",
      "-c",
      type=click.Choice([DEPLOY, PREDICT, DEPLOY_AND_PREDICT]),
      default="deploy_and_predict",
      help="Optionally you can choose to only run the deployment "
      "pipeline to train and deploy a model (`deploy`), or to "
      "only run a prediction against the deployed model "
      "(`predict`). By default both will be run "
      "(`deploy_and_predict`).",
  )
  def main(
      config: str,
  ):
      deploy = config in [DEPLOY, DEPLOY_AND_PREDICT]
      predict = config in [PREDICT, DEPLOY_AND_PREDICT]
  
      if deploy:
          training_fashion_mnist()
      if predict:
          inference_fashion_mnist(
              model_name=MODEL_NAME,
              pipeline_name=PIPELINE_NAME,
              step_name=PIPELINE_STEP_NAME,
          )
  
  
  if __name__ == "__main__":
      main()
  