fastText model serving service
You can download prebuilt binary from GitHub releases, or install it using Cargo:
bash
cargo install fasttext-serving
```bash $ fasttext-serving --help
USAGE:
fasttext-serving [OPTIONS] --model
FLAGS: --grpc Serving gRPC API instead of HTTP API -h, --help Prints help information -V, --version Prints version information
OPTIONS: -a, --address
Listen address [default: 127.0.0.1] -m, --modelPlease refer to Rocket documentation for configuration.
HTTP API endpoint:
POST /predict
Post data should be JSON array of string, for example ["abc", "def"]
CURL example:
bash
$ curl -X POST \
--data "[\"Which baking dish is best to bake a banana bread?\", \"Why not put knives in the dishwasher?\"]" \
'http://localhost:8000/predict'
[[["baking"],[0.7152988]],[["equipment"],[0.73479545]]]
Run the command with --grpc
to serve gRPC API instead of HTTP REST API.
Please refer to gRPC Python client documentation here.
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.