Download app/core/models.py from build-small-hackathon/KnowledgeMesh: direct link, hf CLI and curl.
- Browser
- Download file 873 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/KnowledgeMesh/resolve/main/app/core/models.py
- Command line
-
hf download hf://spaces/build-small-hackathon/KnowledgeMesh/app/core/models.py
-
curl -L -o models.py https://huggingface.co/spaces/build-small-hackathon/KnowledgeMesh/resolve/main/app/core/models.py
873 Bytes
| from dataclasses import dataclass, field | |
| from enum import Enum | |
| from pathlib import Path | |
| from typing import Any | |
| class SourceType(str, Enum): | |
| PDF = "pdf" | |
| ARXIV = "arxiv" | |
| MEDIUM = "medium" | |
| class Document: | |
| source_type: SourceType | |
| title: str | |
| text: str | |
| source: str | |
| metadata: dict[str, Any] = field(default_factory=dict) | |
| class Chunk: | |
| id: str | |
| text: str | |
| index: int | |
| source_type: SourceType | |
| source: str | |
| title: str | |
| metadata: dict[str, Any] = field(default_factory=dict) | |
| class IngestionResult: | |
| document: Document | |
| chunks: list[Chunk] | |
| collection_name: str | |
| export_path: Path | |
| class SearchResult: | |
| score: float | |
| text: str | |
| title: str | |
| source: str | |
| source_type: str | |
| metadata: dict[str, Any] | |