background_task.py 511 B

1234567891011121314151617181920212223
  1. from pydantic import BaseModel
  2. class ModelDownloadTaskResponse(BaseModel):
  3. task_id: str
  4. model_id: str
  5. status: str
  6. use_modelscope: bool = False
  7. path: str | None = None
  8. error: str | None = None
  9. progress: float = 0.0
  10. created_at: str = ""
  11. class DatasetDownloadTaskResponse(BaseModel):
  12. task_id: str
  13. dataset_id: str
  14. status: str
  15. use_modelscope: bool = False
  16. path: str | None = None
  17. error: str | None = None
  18. record_count: int = 0
  19. created_at: str = ""