I have a machine learning model deployed using FastAPI, but the issue is I need the model to take two-body parameters
app = FastAPI()
class Inputs(BaseModel):
industry: str = None
file: UploadFile = File(...)
@app.post("/predict")
async def predict(inputs: Inputs):
# params
industry = inputs.industry
file = inputs.file
### some code ###
return predicted value
When I tried to send the input parameters I am getting an error in postman, please see the pic below,
From the FastAPI discussion thread--(#657)
So, in your case, the router should be as,