https://github.com/altescy/metamaker

⚗️ Simple command line tool to train and deploy your machine learning models with AWS SageMaker

https://github.com/altescy/metamaker

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

fastapi machine-learning poetry python sagemaker

Keywords from Contributors

projection interactive serializer measurement cycles packaging charts network-simulation archival shellcodes
Last synced: 6 months ago · JSON representation

Repository

⚗️ Simple command line tool to train and deploy your machine learning models with AWS SageMaker

Basic Info
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • Open Issues: 7
  • Releases: 1
Topics
fastapi machine-learning poetry python sagemaker
Created over 4 years ago · Last pushed about 3 years ago
Metadata Files
Readme License

README.md

metamaker

Actions Status License Python version pypi version

Simple command line tool to train and deploy your machine learning models with AWS SageMaker

Features

metamaker enables you to:

  • Build a docker image for training and inference with poetry and FastAPI
  • Train your own machine learning model with SageMaker
  • Deploy inference endpoint with SageMaker

Usage

  1. Create poetry project and install metamaker

❯ poetry new your_module ❯ cd your_module ❯ poetry add metamaker

  1. Define scripts for traning and inference in main.py

```main.py from pathlib import Path from typing import Any, Dict

from metamaker import MetaMaker

Import your model, and input/output data classs:

Model ... machine learning model class you want to use

Input ... input data class for inference

Output ... ouput data class for inference

Note that the Input and Output are used as type hints to

create API endpoint with FastAPI like below:

@fastapi_app.post("/invocations")

def predict(data: Input) -> Output:

...

from your_module import Model, Input, Output

app = MetaMakerModel, Input, Output

@app.trainer def train( datasetpath: Path, artifactpath: Path, hyperparameters: Dict[str, Any], ) -> None: model = Model(**hyperparameters) model.train(datasetpath / "train.csv") model.save(artifactpath / "model.tar.gz")

@app.loader def load(artifactpath: Path) -> Model: return Model.load(artifactpath / "model.tar.gz")

@app.predictor def predict(model: Model, data: Input) -> Output: return model.predict(data) ```

  1. Write metamaker configs in metamaker.yaml

```metamaker.yaml

Specify metamaker handler like: path.to.module:app_name

handler: main:app

datasetpath and artifactpath should be directories and end with '/'

datasetpath: s3://your-bucket/path/to/dataset/ artifactpath: s3://your-bucket/path/to/artifacts/

hyperparameter_path: ./hparams.yaml

image: name: metamaker includes: - yourmodule/ - main.py excludes: - _pycache__/ - '*.py[cod]'

training: execution_role: arn:aws:iam::xxxxxxxxxxxx:role/SageMakerExecutionRole instance: type: ml.m5.large count: 1

inference: endpointname: yourendpoint instance: type: ml.t2.meduim count: 1 ```

  1. Build docker image and push to ECR

metamaker build --deploy .

  1. Train your model with SageMaker and deploy endpoint

metamaker sagemaker train --deploy

Owner

  • Name: Yasuhiro Yamaguchi
  • Login: altescy
  • Kind: user
  • Location: Kanagawa, Japan
  • Company: Cookpad Inc.

Research Engineer / NLP / ML

GitHub Events

Total
Last Year

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 54
  • Total Committers: 2
  • Avg Commits per committer: 27.0
  • Development Distribution Score (DDS): 0.037
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
altescy a****y@f****m 52
dependabot[bot] 4****] 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 2
  • Total pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: 15 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.13
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • altescy (2)
Pull Request Authors
  • dependabot[bot] (8)
Top Labels
Issue Labels
Pull Request Labels
dependencies (8)

Dependencies

poetry.lock pypi
  • appdirs 1.4.4 develop
  • atomicwrites 1.4.0 develop
  • black 20.8b1 develop
  • boto3-stubs 1.19.12 develop
  • botocore-stubs 1.22.12 develop
  • colorlog 4.8.0 develop
  • dacite 1.6.0 develop
  • flake8 3.9.2 develop
  • flake8-bugbear 21.9.2 develop
  • gitdb 4.0.9 develop
  • gitpython 3.1.24 develop
  • iniconfig 1.1.1 develop
  • isort 5.1.4 develop
  • jedi 0.17.2 develop
  • mccabe 0.6.1 develop
  • mypy 0.790 develop
  • mypy-boto3-ecr 1.19.12 develop
  • mypy-boto3-s3 1.19.12 develop
  • mypy-boto3-sagemaker 1.19.12 develop
  • mypy-extensions 0.4.3 develop
  • parso 0.7.1 develop
  • pathspec 0.9.0 develop
  • pluggy 1.0.0 develop
  • py 1.11.0 develop
  • pycodestyle 2.7.0 develop
  • pyflakes 2.3.1 develop
  • pysen 0.9.1 develop
  • pytest 6.2.5 develop
  • python-jsonrpc-server 0.4.0 develop
  • python-language-server 0.36.2 develop
  • regex 2021.11.2 develop
  • smmap 5.0.0 develop
  • toml 0.10.2 develop
  • tomlkit 0.7.2 develop
  • typed-ast 1.4.3 develop
  • ujson 5.1.0 develop
  • unidiff 0.7.0 develop
  • anyio 3.3.4
  • asgiref 3.4.1
  • attrs 21.2.0
  • bcrypt 3.2.0
  • boto3 1.19.12
  • botocore 1.22.12
  • certifi 2021.10.8
  • cffi 1.15.0
  • charset-normalizer 2.0.7
  • click 8.0.3
  • colorama 0.4.4
  • cryptography 35.0.0
  • dill 0.3.4
  • distro 1.6.0
  • docker 5.0.0
  • docker-compose 1.29.2
  • dockerpty 0.4.1
  • docopt 0.6.2
  • fastapi 0.70.0
  • google-pasta 0.2.0
  • h11 0.12.0
  • idna 3.3
  • importlib-metadata 4.8.1
  • jmespath 0.10.0
  • jsonschema 3.2.0
  • multiprocess 0.70.12.2
  • numpy 1.21.1
  • packaging 21.2
  • pandas 1.3.4
  • paramiko 2.10.1
  • pathos 0.2.8
  • pox 0.3.0
  • ppft 1.6.6.4
  • protobuf 3.19.1
  • protobuf3-to-dict 0.1.5
  • pycparser 2.21
  • pydantic 1.8.2
  • pynacl 1.4.0
  • pyparsing 2.4.7
  • pyrsistent 0.18.0
  • python-dateutil 2.8.2
  • python-dotenv 0.19.1
  • pytz 2021.3
  • pywin32 227
  • pyyaml 5.4.1
  • requests 2.26.0
  • s3transfer 0.5.0
  • sagemaker 2.68.0
  • six 1.16.0
  • smdebug-rulesconfig 1.0.1
  • sniffio 1.2.0
  • starlette 0.16.0
  • texttable 1.6.4
  • typing-extensions 3.10.0.2
  • urllib3 1.26.7
  • uvicorn 0.15.0
  • websocket-client 0.59.0
  • zipp 3.6.0
pyproject.toml pypi
  • boto3-stubs ^1.19.9 develop
  • pysen ^0.9.1 develop
  • pytest ^6.2.4 develop
  • python-language-server ^0.36.2 develop
  • boto3 ^1.19.9
  • fastapi ^0.70.0
  • pydantic ^1.8.2
  • python ^3.8
  • pyyaml >=5.0,<6.0
  • sagemaker ^2.68.0
  • uvicorn ^0.15.0
.github/workflows/main.yaml actions
  • JRubics/poetry-publish v1.8 composite
  • actions/checkout v2 composite
  • actions/checkout v1 composite
  • actions/setup-python v1 composite