From 3d7efa0eddbbc2b40a78ff58f7095bee70c35f0c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:34:17 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- DocSum/docsum.py | 20 ++++++++++---------- DocSum/tests/test_compose_on_xeon.sh | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DocSum/docsum.py b/DocSum/docsum.py index 40a4a340a..1d71f24ad 100644 --- a/DocSum/docsum.py +++ b/DocSum/docsum.py @@ -58,7 +58,7 @@ def read_pdf(file): def video2audio( - video_base64: str, + video_base64: str, ) -> str: """Convert a base64 video string to a base64 audio string using ffmpeg. @@ -114,8 +114,8 @@ def read_text_from_file(file, save_file_name): file_content = [doc.page_content for doc in documents] # read docx file elif ( - file.headers["content-type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" - or file.headers["content-type"] == "application/octet-stream" + file.headers["content-type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + or file.headers["content-type"] == "application/octet-stream" ): file_content = docx2txt.process(save_file_name) @@ -247,9 +247,9 @@ async def handle_request(self, request: Request, files: List[UploadFile] = File( for node, response in result_dict.items(): # Here it suppose the last microservice in the megaservice is LLM. if ( - isinstance(response, StreamingResponse) - and node == list(self.megaservice.services.keys())[-1] - and self.megaservice.services[node].service_type == ServiceType.LLM + isinstance(response, StreamingResponse) + and node == list(self.megaservice.services.keys())[-1] + and self.megaservice.services[node].service_type == ServiceType.LLM ): return response else: @@ -260,9 +260,9 @@ async def handle_request(self, request: Request, files: List[UploadFile] = File( for node, response in result_dict.items(): # Here it suppose the last microservice in the megaservice is LLM. if ( - isinstance(response, StreamingResponse) - and node == list(self.megaservice.services.keys())[-1] - and self.megaservice.services[node].service_type == ServiceType.LLM + isinstance(response, StreamingResponse) + and node == list(self.megaservice.services.keys())[-1] + and self.megaservice.services[node].service_type == ServiceType.LLM ): return response @@ -297,4 +297,4 @@ def start(self): if __name__ == "__main__": docsum = DocSumService(port=MEGA_SERVICE_PORT) docsum.add_remote_service() - docsum.start() \ No newline at end of file + docsum.start() diff --git a/DocSum/tests/test_compose_on_xeon.sh b/DocSum/tests/test_compose_on_xeon.sh index b4dcb8e59..d353fcefd 100644 --- a/DocSum/tests/test_compose_on_xeon.sh +++ b/DocSum/tests/test_compose_on_xeon.sh @@ -373,4 +373,4 @@ function main() { echo "===========================================" } -main \ No newline at end of file +main