From c01d6833c5e167c22f91e57dc031b31a3e72fa31 Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 15 Mar 2024 15:16:32 +0100 Subject: [PATCH] Remove type hints --- README.md | 2 ++ app.py | 2 +- data/LabeledData.py | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 01691cb..5d16eda 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ ### To run the dummy service: + +make install_venv make start ### Dummy service for diff --git a/app.py b/app.py index c044bfb..f45170b 100644 --- a/app.py +++ b/app.py @@ -72,7 +72,7 @@ async def prediction_data_post(prediction_data: PredictionData): async def get_suggestions(tenant: str, extractor_id: str): predictions_data = json.loads(data_path.read_text()) if exists(data_path) else list() - suggestions_list: list[dict[str, str]] = list() + suggestions_list = list() options = json.loads(options_path.read_text()) if exists(options_path) else list() for prediction_data in predictions_data: suggestions_list.append( diff --git a/data/LabeledData.py b/data/LabeledData.py index ffa5f2c..c25b4a5 100644 --- a/data/LabeledData.py +++ b/data/LabeledData.py @@ -1,3 +1,5 @@ +from typing import List + from pydantic import BaseModel from data.Option import Option @@ -10,11 +12,11 @@ class LabeledData(BaseModel): xml_file_name: str language_iso: str label_text: str = "" - options: list[Option] = list() + options: List[Option] = list() page_width: float page_height: float - xml_segments_boxes: list[SegmentBox] - label_segments_boxes: list[SegmentBox] + xml_segments_boxes: List[SegmentBox] + label_segments_boxes: List[SegmentBox] def correct_data_scale(self): self.label_segments_boxes = [x.correct_input_data_scale() for x in self.label_segments_boxes]