2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-21 13:23:02 +01:00

add tensorflow/serving

This commit is contained in:
kev
2021-12-10 18:23:45 +08:00
parent a4a15a0973
commit 53c61b65f2
6 changed files with 64 additions and 28 deletions

View File

@@ -0,0 +1,16 @@
tenserflow/serving
==================
[TensorFlow Serving][1] is a flexible, high-performance serving system for machine learning models, designed for production environments.
## up and running
```bash
$ mkdir -p data
$ curl -sSL https://github.com/tensorflow/serving/archive/refs/heads/master.tar.gz | tar xz -C data serving/tensorflow_serving/servables/tensorflow/testdata --strip 5
$ docker-compose up -d
$ curl -X POST http://localhost:8501/v1/models/half_plus_two:predict -d '{"instances": [1.0, 2.0, 5.0]}'
{ "predictions": [2.5, 3.0, 4.5] }
```
[1]: https://github.com/tensorflow/serving

View File

@@ -0,0 +1,12 @@
version: "3.8"
services:
serving:
image: tensorflow/serving
ports:
- "8501:8501"
volumes:
- ./data/saved_model_half_plus_two_cpu:/models/half_plus_two
environment:
- MODEL_BASE_PATH=/models
- MODEL_NAME=half_plus_two
restart: unless-stopped