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:
16
tensorflow/serving/README.md
Normal file
16
tensorflow/serving/README.md
Normal 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
|
||||
12
tensorflow/serving/docker-compose.yml
Normal file
12
tensorflow/serving/docker-compose.yml
Normal 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
|
||||
Reference in New Issue
Block a user