Skip to content

portmind/inferio-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InferIO-X

Inference I/O Extended

Python Code style: black Ruff pre-commit Conventional Commits

Installation

$ pip install inferio-x==0.1.0

Usage

from pydantic import BaseModel
from inferio import Service, Endpoint, Method


class PredictPayload(BaseModel):
    name: str
    age: int


class Predictor:
    def __init__(self, model_f: str) -> None:
        self.model_f = model_f

    def predict(self, payload: PredictPayload) -> dict: ...


if __name__ == "__main__":
    predictor = Predictor(model_f="model.pth")
    service = Service(
    endpoints=[
        Endpoint(path="/", handler=predictor.predict, methods=[Method.POST]),
    ])
    service.run()

Tests

To run the tests, use the following command:

$ poetry run pytest