Download mindxtrain/storage/provider.py from PYTHAI/mindXtrain: direct link, hf CLI and curl.
- Browser
- Download file 789 Bytes
-
https://huggingface.co/PYTHAI/mindXtrain/resolve/main/mindxtrain/storage/provider.py
- Command line
-
hf download hf://PYTHAI/mindXtrain/mindxtrain/storage/provider.py
-
curl -L -o provider.py https://huggingface.co/PYTHAI/mindXtrain/resolve/main/mindxtrain/storage/provider.py
789 Bytes
| """StorageProvider — uniform interface across local fs / HF Hub / Lighthouse / IPFS. | |
| Canonical mindxtrain2.md §Part 4 `storage.provider`. Concrete implementations | |
| live alongside (`local_fs`, `hf_hub`, `lighthouse`, `ipfs`). Selected at | |
| runtime via `cfg.publish.storage_provider`. | |
| """ | |
| from __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from pathlib import Path | |
| from pydantic import BaseModel, ConfigDict | |
| class StorageRef(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| provider: str | |
| uri: str | |
| class StorageProvider(ABC): | |
| """Pluggable storage backend.""" | |
| name: str | |
| def put_dir(self, src: Path, key: str) -> StorageRef: ... | |
| def get_dir(self, ref: StorageRef, dest: Path) -> Path: ... | |