2024-04-06 13:02:31 -07:00
|
|
|
import click
|
|
|
|
|
|
|
|
@click.group()
|
|
|
|
@click.version_option()
|
|
|
|
def cli():
|
|
|
|
"""
|
2024-04-06 15:48:29 -07:00
|
|
|
build, train and run machine learning models.
|
2024-04-06 13:02:31 -07:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command("pipeline:train")
|
|
|
|
def pipeline_train():
|
|
|
|
"""run the training pipeline with train data"""
|
2024-04-06 15:48:29 -07:00
|
|
|
from {{cookiecutter.module_name}}.training import pipeline
|
2024-04-06 13:02:31 -07:00
|
|
|
pipeline.run(evaluate=False)
|
|
|
|
|
|
|
|
@cli.command("pipeline:evaluate")
|
|
|
|
def pipeline_evaluate():
|
|
|
|
"""run the training pipeline with test data"""
|
2024-04-06 15:48:29 -07:00
|
|
|
from {{cookiecutter.module_name}}.training import pipeline
|
2024-04-06 13:02:31 -07:00
|
|
|
pipeline.run(evaluate=True)
|
|
|
|
|
|
|
|
@cli.command("app:serve")
|
|
|
|
def app_serve():
|
|
|
|
"""run the api server pipeline with pretrained model"""
|
2024-04-06 15:48:29 -07:00
|
|
|
from {{cookiecutter.module_name}} import app
|
2024-04-06 13:02:31 -07:00
|
|
|
app.run()
|
|
|
|
|
|
|
|
@cli.command("data:download")
|
|
|
|
def data_download():
|
|
|
|
"""download the train and test data"""
|
2024-04-06 15:48:29 -07:00
|
|
|
from {{cookiecutter.module_name}} import data
|
|
|
|
from {{cookiecutter.module_name}} import config
|
2024-04-06 13:02:31 -07:00
|
|
|
from pathlib import Path
|
|
|
|
data.download(Path(config.paths.data))
|
|
|
|
|
|
|
|
@cli.command("data:debug")
|
|
|
|
def data_debug():
|
|
|
|
"""debug the dataset class"""
|
2024-04-06 15:48:29 -07:00
|
|
|
from {{cookiecutter.module_name}}.data import dataset
|
2024-04-06 13:02:31 -07:00
|
|
|
dataset.debug()
|