Spaces:
Runtime error
Runtime error
Download src/models/ml.py from Marintosti/deploy-machine-learning: direct link, hf CLI and curl.
- Browser
- Download file 755 Bytes
-
https://huggingface.co/spaces/Marintosti/deploy-machine-learning/resolve/main/src/models/ml.py
- Command line
-
hf download hf://spaces/Marintosti/deploy-machine-learning/src/models/ml.py
-
curl -L -o ml.py https://huggingface.co/spaces/Marintosti/deploy-machine-learning/resolve/main/src/models/ml.py
755 Bytes
| import uuid | |
| from datetime import datetime | |
| from sqlalchemy import String, Text, DateTime, Boolean | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from .base import Base | |
| class MLModel(Base): | |
| __tablename__ = "ml_models" | |
| id: Mapped[uuid.UUID] = mapped_column( | |
| UUID(as_uuid=True), primary_key=True, default=uuid.uuid4 | |
| ) | |
| name: Mapped[str] = mapped_column(String(100), nullable=False, unique=True) | |
| description: Mapped[str | None] = mapped_column(Text, nullable=True) | |
| created_at: Mapped[datetime] = mapped_column( | |
| DateTime(timezone=True), default=datetime.utcnow, nullable=False | |
| ) | |
| is_active: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False) | |