Initial Real-ESRGAN API project setup
This commit is contained in:
31
app/schemas/models.py
Normal file
31
app/schemas/models.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Schemas for model management operations."""
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class ModelDownloadRequest(BaseModel):
|
||||
"""Request to download models."""
|
||||
models: List[str] = Field(
|
||||
description='List of model names to download'
|
||||
)
|
||||
provider: str = Field(
|
||||
default='huggingface',
|
||||
description='Repository provider (huggingface, gdrive, etc.)'
|
||||
)
|
||||
|
||||
|
||||
class ModelDownloadResponse(BaseModel):
|
||||
"""Response from model download."""
|
||||
success: bool
|
||||
message: str
|
||||
downloaded: List[str] = Field(default_factory=list)
|
||||
failed: List[str] = Field(default_factory=list)
|
||||
errors: dict = Field(default_factory=dict)
|
||||
|
||||
|
||||
class ModelListResponse(BaseModel):
|
||||
"""Response containing list of models."""
|
||||
available_models: List[dict]
|
||||
total_models: int
|
||||
local_models: int
|
||||
Reference in New Issue
Block a user