Truss 101: Model serving
Step 2: Call the model server
Call predict to test the model server
Once your model server has finished deploying, you can call it from your terminal.
Call the model server
Model server input must be JSON-serializable: a string, number, list, or dictionary.
Note the double quotes to make the data parameter a string.
truss predict
uses the same data formatting on the as cURL.
Invocation
truss predict -d '"Truss is awesome!"'
Response
"Truss is awesome!"
Our model server is up and responding to requests. In the next step, we’ll set up the last piece of the developer loop on Truss.
class Model:
def __init__(self, **kwargs):
self._model = None
def load(self):
pass
def predict(self, model_input):
return model_input
class Model:
def __init__(self, **kwargs):
self._model = None
def load(self):
pass
def predict(self, model_input):
return model_input