Skip to content

Commit

Permalink
C/hange segment box to work with Uwazi validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-piles committed Oct 21, 2024
1 parent b506e08 commit c3108d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def labeled_data_post(labeled_data: LabeledData):
@app.post("/prediction_data")
async def prediction_data_post(prediction_data: PredictionData):
predictions_data = json.loads(data_path.read_text()) if exists(data_path) else list()
predictions_data.append(prediction_data.dict())
predictions_data.append(prediction_data.model_dump())
data_path.write_text(json.dumps(predictions_data))
return "prediction data saved"

Expand Down
8 changes: 4 additions & 4 deletions data/SegmentBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SegmentBox(BaseModel):
width: float = 3
height: float = 4
page_number: int = 1
page_width: int = 600
page_height: int = 800
text: str = ""
type: TokenType = TokenType.TEXT
# page_width: int = 600
# page_height: int = 800
# text: str = ""
# type: str = "TEXT"

0 comments on commit c3108d4

Please sign in to comment.