A webapp for inspecting model predictions.
First, write a YAML configuration file that may contain the following fields:
title: My Morse App
inputs:
- name: x1
display: First input
type: string
bootstrap-cols: 9
- name: x2
display: Second input
type: integer
bootstrap-cols: 3
default: 10
outputs:
- name: y1
display: First output
type: string
- name: y2
display: Second output
type: float
Now write some code to get predictions out of your model and start the server:
from morse import Morse
def query_model(x1, x2):
# Some code here to generate model predictions
# Return a dict containing all predictions
y1, y2 = my_model.predict(x1, x2)
return {'y1': y1, 'y2': y2}
app = morse.Morse(query_model, 'path/to/config.yaml')
app.serve()
See the examples
directory for more information.