-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
31 lines (24 loc) · 744 Bytes
/
schemas.py
File metadata and controls
31 lines (24 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from pydantic import BaseModel
from typing import List, Dict, Any, Union, Optional
class MaskingResponse(BaseModel):
masked_text: str
class PDFQuestionResponse(BaseModel):
answer: str
class QA(BaseModel):
question: str
class ImageMaskingResponse(BaseModel):
boxes: List[List[float]]
labels: List[str]
scores: List[float]
masked_image: str
class ErrorResponse(BaseModel):
error: str
class QueryIn(BaseModel):
qa: QA
pre_text: Optional[List[str]] # Optional list of strings
post_text: Optional[List[str]] # Optional list of strings
table: List[List[str]] # List of lists of strings
class GenerateOut(BaseModel):
gold_inds: List[str]
program: str
result: Union[float, str]