0

I am using FastAPI for Machine Learning model deployment in two cases based on the nature of the data we feed as inputs (features) which it an array of json. Thus, if inputs are matching method1 we execute the according model to it otherwise we apply method2 and execute the trained model for this case.

How can I achieve this process using FastAPI ? (process of verifieng the input data and apply the matching model for that data)

Legna
  • 125
  • 1
  • 1
  • 10

1 Answers1

1

You can create a pydantic scheme as a dependency, that includes all the possible fields (Optional) for both data types and check incoming data by special field into it. Also you can use different routes. Could you show JSON samples?