From 01b0f1ab1fdb3d9ece42fbab0b75119af4ffdf9e Mon Sep 17 00:00:00 2001 From: farisdurrani Date: Fri, 7 Jul 2023 01:40:47 +0000 Subject: [PATCH] :art: Format Python code with psf/black --- backend/aws_helpers/s3_utils/s3_client.py | 1 + backend/dl/detection.py | 5 ++++- backend/dl/dl_model_parser.py | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/aws_helpers/s3_utils/s3_client.py b/backend/aws_helpers/s3_utils/s3_client.py index 07e5136e1..6430a591a 100644 --- a/backend/aws_helpers/s3_utils/s3_client.py +++ b/backend/aws_helpers/s3_utils/s3_client.py @@ -80,6 +80,7 @@ def make_train_bucket_path(trainspace_data: TrainspaceData) -> str: filename = trainspace_data.dataset_data["name"] return f"{uid}/{data_source}/{filename}" + def get_presigned_url_from_bucket(bucket_name: str, bucket_path: str): """ Given S3 URI, read the file from the S3 bucket diff --git a/backend/dl/detection.py b/backend/dl/detection.py index c1c988766..1985b97c1 100644 --- a/backend/dl/detection.py +++ b/backend/dl/detection.py @@ -1,6 +1,9 @@ from backend.aws_helpers.dynamo_db_utils.trainspace_db import TrainspaceData from backend.aws_helpers.s3_utils.s3_bucket_names import FILE_UPLOAD_BUCKET_NAME -from backend.aws_helpers.s3_utils.s3_client import make_train_bucket_path, read_from_bucket +from backend.aws_helpers.s3_utils.s3_client import ( + make_train_bucket_path, + read_from_bucket, +) from backend.common.constants import IMAGE_FILE_DOWNLOAD_TMP_PATH from transformers import YolosFeatureExtractor, YolosForObjectDetection import torch diff --git a/backend/dl/dl_model_parser.py b/backend/dl/dl_model_parser.py index 16af7deba..2e4195fd4 100644 --- a/backend/dl/dl_model_parser.py +++ b/backend/dl/dl_model_parser.py @@ -37,12 +37,12 @@ def parse_deep_user_architecture(layers): converted_data = [] for item in layers: - value = item['value'] - parameters = item['parameters'] + value = item["value"] + parameters = item["parameters"] if value not in LAYERS_NN_MAPPING: raise Exception(f"Layer ${value} not supported") - + linear_layer = LAYERS_NN_MAPPING[value](*parameters) converted_data.append(linear_layer)