Spaces:
Sleeping
Sleeping
Download schemas.py from KnowingFly/depression-detection-api: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/spaces/KnowingFly/depression-detection-api/resolve/main/schemas.py
- Command line
-
hf download hf://spaces/KnowingFly/depression-detection-api/schemas.py
-
curl -L -o schemas.py https://huggingface.co/spaces/KnowingFly/depression-detection-api/resolve/main/schemas.py
727 Bytes
| from pydantic import BaseModel, Field | |
| class PredictionResponse(BaseModel): | |
| """Response model for depression prediction endpoint.""" | |
| prediction: str = Field(..., description="Prediction result: 'depression' or 'neutral'") | |
| confidence: float = Field(..., description="Confidence score between 0 and 1", ge=0.0, le=1.0) | |
| class HealthResponse(BaseModel): | |
| """Response model for health check endpoint.""" | |
| status: str = Field(..., description="Health status of the API") | |
| model_loaded: bool = Field(..., description="Whether the ML model is loaded successfully") | |
| class ErrorResponse(BaseModel): | |
| """Response model for error responses.""" | |
| detail: str = Field(..., description="Error message details") | |