File size: 632 Bytes
b7bd3ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from typing import Any, Dict, Optional
# from huggingface_hub import SpaceStage
from pydantic import BaseModel, Field

class DeployRequest(BaseModel):
    hf_token: str = Field(..., description="HF token with write permission")
    git_repo_url: str = Field(...)
    deploy_path: str = Field("/")
    space_name: str = Field(...)
    space_port: int = Field(7860)
    description: str = Field("")
    env_vars: Dict[str, str] = Field(default_factory=dict)
    private: bool = Field(False)

class DeployStatus(BaseModel):
    task_id: str
    status: str  # PENDING | IN_PROGRESS | SUCCESS | FAILED
    detail: Optional[Any] = None