Update app.py
Browse files84 unmodified lines85868788899091929394959697989910010110210310484 unmodified lineslogger.info(f"Successfully processed request. Returning {len(results)} predictions.")return resultsexcept ValidationError as e:logger.error(f"Validation error for request: {e.errors()}")raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,detail=e.errors())except HTTPException:raiseexcept Exception as e:logger.exception(f"An unexpected error occurred during prediction: {e}")raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,detail=f"An internal server error occurred: {e}")@api_router.get("/health", # Health check endpoint84 unmodified lines85868788899091929394959697989910010110210310484 unmodified lineslogger.info(f"Successfully processed request. Returning {len(results)} predictions.")return resultsexcept ValidationError as e: # This is line 88logger.error(f"Validation error for request: {e.errors()}")raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,detail=e.errors())except HTTPException:raiseexcept Exception as e:logger.exception(f"An unexpected error occurred during prediction: {e}")raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,detail=f"An internal server error occurred: {e}")@api_router.get("/health", # Health check endpoint
app.py+14-14