Assignment: Build a REST API in JavaScript that consumes the model
- Take the model we created in the previous section and add the code to the notebook to turn it into an ONNX file.
- Create a new folder in the repo called and create a new file called
app.js
in that folder. - Add the POST /predict route to the
server.js
file and ensure it returns a prediction given the input.
Here’s some starter prompts you can try to help you with this assignment:
- Prompt: Create a REST API in JavaScript using Express
- Prompt: Create a POST /predict route in a REST API in JavaScript using Express
- Prompt: Load the model from ONNX in a REST API in JavaScript using Express
- Prompt: Predict using the ONNX model in a REST API in JavaScript using Express