Conversation
add get_predictions add get_explanations add get_workflow_predictions
|
I created my own branch from your 'inference' branch. I'm not sure whether to return the response or its jsonified version. |
|
I don't think we should implement a logic depending on the input type inside of the InferenceApi. |
yes, it feels straightforward to convert the inputs to a common type Input request parsing logics are here and also here. We can just implement things the predefined/base classes (for now). For example VisionHandler request would be input_=open(file_path).read()
httpx.post(PRED_API, data=input_) #or files={'data': input_} ?That said, I have built custom handlers that expect different inputs like: input_={
"path":file_path,
"some_other_param":'blahblah'
}
httpx.post(PRED_API, json=input_) # which requires a whole different request format and would fail otherwise
Also it is not possible to determine which UI to show for which model endpoint. But that wouldn't be as cool as swagger UI. Fastapi uses a pydantic BaseModel to define a response type class to solve this problem. From BaseModel it is possible to get an openapi schema. I think the |
add get_predictions
add get_explanations
add get_workflow_predictions