Define Prediction Functions
Learn how to define a prediction function for model inference.
We'll cover the following
Modeling application: Inferences with user set values
In this lesson, we are going to add a prediction function. This function will take in the various inputs set by the user based on the interactions with the various Gradio components, and reshape it into a format that can be fed into the model to generate an inference.
This is not different from any function that we might write to make inferences in Python. The inputs to this function will be preprocessed values from the Gradio input components, which are read in as strings or numeric values depending on the component. Recall that Gradio components involve the preprocessing of inputs before being passed into Python functions.
We will dive into the code to see more clearly what this looks like.
Get hands-on with 1300+ tech skills courses.