Create image with Dockerfile
Step 1 - Create your source code
Python file
class MyModel(object):
"""
Model template. You can load your model parameters in __init__ from a location accessible at runtime
"""
def __init__(self):
"""
Add any initialization parameters. These will be passed at runtime from the graph definition parameters defined in your seldondeployment kubernetes resource manifest.
"""
print("Initializing")
def predict(self,X,features_names):
"""
Return a prediction.
Parameters
----------
X : array-like
feature_names : array of feature names (optional)
"""
print("Predict called - will run identity function")
return Xrequirements.txt
Step 2 - Define the Dockerfile
Step 3 - Build your image
Using with Keras/Tensorflow Models
Environment Variables
MODEL_NAME
SERVICE_TYPE
Flask Settings
Creating different service types
MODEL
ROUTER
TRANSFORMER
Advanced Usage
Model Class Arguments
Custom Metrics
Custom Request Tags
Last updated
Was this helpful?