Spaces:
Sleeping
Sleeping
Download app/models/document.py from vara201/simple-rag: direct link, hf CLI and curl.
- Browser
- Download file 884 Bytes
-
https://huggingface.co/spaces/vara201/simple-rag/resolve/main/app/models/document.py
- Command line
-
hf download hf://spaces/vara201/simple-rag/app/models/document.py
-
curl -L -o document.py https://huggingface.co/spaces/vara201/simple-rag/resolve/main/app/models/document.py
884 Bytes
| import uuid | |
| from sqlalchemy import String, Text | |
| from sqlalchemy.orm import ( | |
| Mapped, | |
| mapped_column | |
| ) | |
| from app.models.base import Base | |
| class Document(Base): | |
| __tablename__ = "documents" | |
| id: Mapped[str] = mapped_column( | |
| String, | |
| primary_key=True, | |
| default=lambda: str(uuid.uuid4()) | |
| ) | |
| user_id: Mapped[str] = mapped_column( | |
| String, | |
| index=True | |
| ) | |
| filename: Mapped[str] = mapped_column( | |
| String | |
| ) | |
| file_path: Mapped[str] = mapped_column( | |
| String | |
| ) | |
| status: Mapped[str] = mapped_column( | |
| String, | |
| default="uploaded" | |
| ) | |
| chunking_strategy: Mapped[str | None] = mapped_column( | |
| String, | |
| nullable=True | |
| ) | |
| text_content: Mapped[str | None] = mapped_column( | |
| Text, | |
| nullable=True | |
| ) |