Code Monkey home page Code Monkey logo

machine-learning-inference-with-github-actions's Introduction

Machine Learning Inference with GitHub Actions

This repository demonstrated how you can use Github Actions to perform inference with your ML models. In this example scenario a Random Forest classifier is used to make predictions trained on the Iris dataset.

sample comment prediction

The GitHub Actions workflow is triggered when an issue receives a comment. If the comment contains the /predict prefix, then the main.py python file starts to parse the comment, make a prediction and construct the reply to the original comment with the prediction.

Example (and also valid) comment: /predict <sepal_length> <sepal_width> <petal_length> <petal_width> (e.g. /predict 5.6 2.9 3.6 1.3)

job steps

Try it out 😎

Just go to an issue at this repository and then leave a comment with the /predict prefic and then 4 numbers separated by spaces. Just like the example above.

/predict 5.6 2.9 3.6 1.3

Files

  • action.yml: Describes the action which build a Docker image and performs the comment parsing and inference
  • .github/workflows/main.yaml: contains the steps which are performed when a comment is received under an issue
  • Dockerfile: This is the image which will be built and used for the main action
  • issue_comment.sh: With this script you can send a comment with the GitHub Rest API
  • main.py: parses the content of the comment, loads model, makes prediction and constructs the reply message
  • random_forest_model.pkl: Serialized trained sklearn model which will be used for inference (btw. this file should not be here, as model artifacts should be stored in a storage, but this is just a sample so... πŸ˜„)

About

GΓ‘bor Vecsei

machine-learning-inference-with-github-actions's People

Contributors

gaborvecsei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

machine-learning-inference-with-github-actions's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.