Spaces:
Paused
Paused
Download app/models.py from imkrish/rag-qa-system: direct link, hf CLI and curl.
- Browser
- Download file 567 Bytes
-
https://huggingface.co/spaces/imkrish/rag-qa-system/resolve/main/app/models.py
- Command line
-
hf download hf://spaces/imkrish/rag-qa-system/app/models.py
-
curl -L -o models.py https://huggingface.co/spaces/imkrish/rag-qa-system/resolve/main/app/models.py
567 Bytes
| from pydantic import BaseModel, Field | |
| from typing import List, Optional | |
| class UploadResponse(BaseModel): | |
| job_id: str | |
| status: str | |
| class JobStatus(BaseModel): | |
| id: str | |
| filename: str | |
| status: str | |
| error: Optional[str] | |
| class QARequest(BaseModel): | |
| question: str = Field(..., min_length=3, max_length=500) | |
| top_k: int = Field(4, ge=1, le=10) | |
| class ContextChunk(BaseModel): | |
| score: float | |
| source: str | |
| doc_id: str | |
| chunk: str | |
| class QAResponse(BaseModel): | |
| answer: str | |
| contexts: List[ContextChunk] | |
| latency_ms: int | |