Download models.py from BajajHackathon/Bajaj_Hackathon_Space: direct link, hf CLI and curl.
- Browser
- Download file 835 Bytes
-
https://huggingface.co/spaces/BajajHackathon/Bajaj_Hackathon_Space/resolve/main/models.py
- Command line
-
hf download hf://spaces/BajajHackathon/Bajaj_Hackathon_Space/models.py
-
curl -L -o models.py https://huggingface.co/spaces/BajajHackathon/Bajaj_Hackathon_Space/resolve/main/models.py
835 Bytes
| from pydantic import BaseModel, HttpUrl, Field | |
| from typing import List | |
| class QueryRequest(BaseModel): | |
| documents: HttpUrl | |
| questions: List[str] | |
| class QueryResponse(BaseModel): | |
| answers: List[str] | |
| class Question(BaseModel): | |
| question: str | |
| class FinalAnswer(BaseModel): | |
| answer: str = Field(description="The complete and detailed answer to the user's question, based strictly on the provided context.") | |
| class FinalAnswerList(BaseModel): | |
| answers: List[FinalAnswer] = Field(description="A list of final answers for each corresponding input question.") | |
| class GeneratedQueriesForEachQuestion(BaseModel): | |
| queries: List[str] = Field(description="A list of 3 distinct, self-contained search queries based on the original question.") | |
| class GeneratedQueries(BaseModel): | |
| lst: List[GeneratedQueriesForEachQuestion] |