Bento ML classifier batch inference with csv file input #1224
-
Hi, I'm trying to build an HTTP post request passing a csv file to my packed model. This is how I produced my iris_5.csv: With Here is my main.py to train and pack the model.
This is my IrisClassifier prediction service class:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
See the doc: https://docs.bentoml.org/en/latest/api/adapters.html#dataframeinput curl -i \
--header "Content-Type: text/csv" \
--request POST \
--data-binary @file.csv \
localhost:5000/predict By the former command, the data of HTTP request would be a string "iris_5.csv” rather than content of the file. |
Beta Was this translation helpful? Give feedback.
curl -i --header "Content-Type: text/csv" --request POST --data iris_5.csv localhost:5000/predict
❌curl -i --header "Content-Type: text/csv" --request POST --data-binary @iris_5.csv localhost:5000/predict
✅See the doc: https://docs.bentoml.org/en/latest/api/adapters.html#dataframeinput
curl -i \ --header "Content-Type: text/csv" \ --request POST \ --data-binary @file.csv \ localhost:5000/predict
By the former command, the data of HTTP request would be a string "iris_5.csv” rather than content of the file.