Spaces:
Sleeping
Sleeping
Download backend/ml_module/core/artifacts.py from ranilmukesh/sirus: direct link, hf CLI and curl.
- Browser
- Download file 865 Bytes
-
https://huggingface.co/spaces/ranilmukesh/sirus/resolve/main/backend/ml_module/core/artifacts.py
- Command line
-
hf download hf://spaces/ranilmukesh/sirus/backend/ml_module/core/artifacts.py
-
curl -L -o artifacts.py https://huggingface.co/spaces/ranilmukesh/sirus/resolve/main/backend/ml_module/core/artifacts.py
865 Bytes
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from datetime import datetime, timezone | |
| def _utcnow() -> datetime: | |
| return datetime.now(timezone.utc) | |
| from typing import Any, Dict, Optional | |
| class StoredArtifactInfo: | |
| """Lightweight description of an artifact persisted to storage.""" | |
| path: str | |
| size_bytes: int | |
| checksum: str | |
| created_at: datetime = field(default_factory=_utcnow) | |
| content_type: Optional[str] = None | |
| metadata: Dict[str, Any] = field(default_factory=dict) | |
| def as_dict(self) -> Dict[str, Any]: | |
| return { | |
| "path": self.path, | |
| "size_bytes": self.size_bytes, | |
| "checksum": self.checksum, | |
| "created_at": self.created_at.isoformat(), | |
| "content_type": self.content_type, | |
| "metadata": self.metadata, | |
| } | |