Spaces:
Runtime error
Runtime error
Download app/schemas/models.py from lukhsaankumar/DeepFakeDetectorBackend: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/spaces/lukhsaankumar/DeepFakeDetectorBackend/resolve/main/app/schemas/models.py
- Command line
-
hf download hf://spaces/lukhsaankumar/DeepFakeDetectorBackend/app/schemas/models.py
-
curl -L -o models.py https://huggingface.co/spaces/lukhsaankumar/DeepFakeDetectorBackend/resolve/main/app/schemas/models.py
1.62 kB
| """ | |
| Pydantic schemas for model-related endpoints. | |
| """ | |
| from typing import Dict, List, Literal, Optional, Any | |
| from pydantic import BaseModel, Field | |
| class ModelInfo(BaseModel): | |
| """Information about a loaded model.""" | |
| repo_id: str = Field(..., description="Hugging Face repository ID") | |
| name: str = Field(..., description="Short name of the model") | |
| model_type: Literal["submodel", "fusion"] = Field( | |
| ..., | |
| description="Type of model" | |
| ) | |
| config: Optional[Dict[str, Any]] = Field( | |
| None, | |
| description="Model configuration from config.json" | |
| ) | |
| class ModelsListResponse(BaseModel): | |
| """Response schema for listing models.""" | |
| fusion: Optional[ModelInfo] = Field( | |
| None, | |
| description="Fusion model information" | |
| ) | |
| submodels: List[ModelInfo] = Field( | |
| default_factory=list, | |
| description="List of loaded submodels" | |
| ) | |
| total_count: int = Field(..., description="Total number of loaded models") | |
| class HealthResponse(BaseModel): | |
| """Response schema for health check.""" | |
| status: Literal["ok", "error"] = Field(..., description="Health status") | |
| class ReadyResponse(BaseModel): | |
| """Response schema for readiness check.""" | |
| status: Literal["ready", "not_ready"] = Field(..., description="Readiness status") | |
| models_loaded: bool = Field(..., description="Whether models are loaded") | |
| fusion_repo: Optional[str] = Field(None, description="Fusion repository ID") | |
| submodels: List[str] = Field( | |
| default_factory=list, | |
| description="List of loaded submodel repository IDs" | |
| ) | |