Main backend module, which is used for developing web-app logic and deploying AI model.
Project description
backend-module
Main backend module, which is used for developing web-app logic and deploying AI model.
Usage - Phase 1
Step 1: Install and update Docker and Docker Compose.
Step 2: Put the desired model into your app with the following path:
ml\model\<model_name>
Step 3: Config model name as an environment variable in .env file.
Step 4: Build and run docker
$ docker-compose build
$ docker-compose up -d
Usage - Phase 2
We develop a RESTful web controller into a reusable library between many AI models. With these functionalities: Input model, Define data input, logging, exception handler.
Installing
Delivering and versioning as a PyPi package. Install and update using pip:
$ pip install annhub-python
A simple example
from annhub_python import PyAnn
pyann = PyAnn()
# Define the expected AI model
pyann.set_model("D:\ARI\ANSCENTER\TrainedModel_c++.ann")
# Define which model ID will be used
pyann.set_model_id(5122020)
# Define the input corresponding to the choosen model
pyann.set_input_length(4)
if __name__ == "__main__":
pyann.run(host = "0.0.0.0", port = 8080, debug = False)
API
The library will product two APIs: health checking, predicting as well as a Swagger UI for API documentation.
GET: /api/v1/health
POST: /api/v1/predict
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file annhub_python-0.1.5.tar.gz
.
File metadata
- Download URL: annhub_python-0.1.5.tar.gz
- Upload date:
- Size: 55.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.8.8 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b47b4a18149872f6573020ffbd992f47fbbcfcd73afed125aabe5ebc80b1a124 |
|
MD5 | b5cbc41bfba037ac39d225fab6988480 |
|
BLAKE2b-256 | 637d4358e50c1e5e34c64f10e4394b2bc9a7007307884c56c0bfd708556913c5 |
File details
Details for the file annhub_python-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: annhub_python-0.1.5-py3-none-any.whl
- Upload date:
- Size: 56.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.8.8 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6038395d7943bbc483ba3c38995ba7619425a2e8df33385bd4d7cdfc19126e8 |
|
MD5 | 75402d0743934312baf3c0a2d9fdbe88 |
|
BLAKE2b-256 | 483d139b71982f2cdca25a7a6df4eca1ad43dd013834e4b1f742dc0bb3978469 |