Handle an incoming HTTP request using FastAPI. Inputs are automatically validated using the Pydantic model.
(self, request: ImageRequest)
| 153 | |
| 154 | @app.post("/") |
| 155 | async def handle_request(self, request: ImageRequest): |
| 156 | """Handle an incoming HTTP request using FastAPI. |
| 157 | |
| 158 | Inputs are automatically validated using the Pydantic model. |
| 159 | """ |
| 160 | # Process the single request. |
| 161 | image_array = np.array(request.image) |
| 162 | |
| 163 | # Ray Serve's @serve.batch automatically batches requests. |
| 164 | result = await self.predict_batch(image_array) |
| 165 | |
| 166 | return result |
| 167 | |
| 168 | |
| 169 | ###################################################################### |
nothing calls this directly
no test coverage detected