diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 972776fbd4..7c59943a27 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer files: (.*\.(py|md|rst|yaml|yml|json|ts|js|html|svelte|sh))$ @@ -26,7 +26,7 @@ repos: args: [--fix=lf] - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.5 + rev: v1.5.6 hooks: - id: insert-license files: (Dockerfile)$ @@ -74,7 +74,7 @@ repos: name: Unused noqa - repo: https://github.com/pycqa/isort - rev: 6.0.1 + rev: 8.0.1 hooks: - id: isort @@ -99,14 +99,14 @@ repos: additional_dependencies: - prettier@3.2.5 - - repo: https://github.com/psf/black.git - rev: 25.1.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black files: (.*\.py)$ - repo: https://github.com/asottile/blacken-docs - rev: 1.19.1 + rev: 1.20.0 hooks: - id: blacken-docs args: [--line-length=120, --skip-errors] @@ -114,7 +114,7 @@ repos: - black==24.10.0 - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 + rev: v2.4.2 hooks: - id: codespell args: [-w] @@ -122,7 +122,7 @@ repos: - tomli - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.2 + rev: v0.15.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --no-cache] diff --git a/AvatarChatbot/ui/gradio/app_gradio_demo_avatarchatbot.py b/AvatarChatbot/ui/gradio/app_gradio_demo_avatarchatbot.py index 1aad8c56cc..b59018935c 100644 --- a/AvatarChatbot/ui/gradio/app_gradio_demo_avatarchatbot.py +++ b/AvatarChatbot/ui/gradio/app_gradio_demo_avatarchatbot.py @@ -195,12 +195,10 @@ def initial_process(audio_input, face_input, model_choice): gr.Markdown("

A PyTorch and OPEA based AI Avatar Audio Chatbot

") with gr.Row(): with gr.Column(scale=8): - gr.Markdown( - """ + gr.Markdown("""

Welcome to our AI Avatar Audio Chatbot! This application leverages PyTorch and OPEA (Open Platform for Enterprise AI) v0.8 to provide you with a human-like conversational experience. It's run on Intel® Gaudi® AI Accelerator and Intel® Xeon® Processor, with hardware and software optimizations.
Please feel free to interact with the AI avatar by choosing your own avatar and talking into the mic.

- """ - ) + """) with gr.Column(scale=1): # with gr.Row(): # gr.Markdown(f""" @@ -285,8 +283,7 @@ def initial_process(audio_input, face_input, model_choice): # Technical details gr.Markdown("
") # Divider with gr.Row(): - gr.Markdown( - """ + gr.Markdown("""

OPEA megaservice deployed:

- """ - ) + """) with gr.Row(): gr.Image("assets/img/flowchart.png", label="Megaservice Flowchart") with gr.Row(): - gr.Markdown( - """ + gr.Markdown("""

The AI Avatar Audio Chatbot is powered by the following Intel® AI software:

- """ - ) + """) # Disclaimer gr.Markdown("
") # Divider gr.Markdown("

Notices & Disclaimers

") - gr.Markdown( - """ + gr.Markdown("""

Intel is committed to respecting human rights and avoiding complicity in human rights abuses. See Intel's Global Human Rights Principles. Intel's products and software are intended only to be used in applications that do not cause or contribute to a violation of an internationally recognized human right.

© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.

You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products described herein. You agree to grant Intel a non-exclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosed herein.

- """ - ) + """) # State transitions # for i in range(len(image_pils)): diff --git a/ChatQnA/docker_compose/amd/cpu/epyc/milvus.yaml b/ChatQnA/docker_compose/amd/cpu/epyc/milvus.yaml index 0526415e12..295cde04cc 100644 --- a/ChatQnA/docker_compose/amd/cpu/epyc/milvus.yaml +++ b/ChatQnA/docker_compose/amd/cpu/epyc/milvus.yaml @@ -424,7 +424,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/milvus.yaml b/ChatQnA/docker_compose/intel/cpu/xeon/milvus.yaml index b9f22cb3d1..8118a41ece 100644 --- a/ChatQnA/docker_compose/intel/cpu/xeon/milvus.yaml +++ b/ChatQnA/docker_compose/intel/cpu/xeon/milvus.yaml @@ -423,7 +423,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/CogniwareIms/backend/app/services/dbqna_service.py b/CogniwareIms/backend/app/services/dbqna_service.py index 8446f4861c..35ae7bd6b4 100644 --- a/CogniwareIms/backend/app/services/dbqna_service.py +++ b/CogniwareIms/backend/app/services/dbqna_service.py @@ -45,25 +45,21 @@ async def get_schema(self) -> Dict[str, Any]: # Get table information with engine.connect() as conn: # Get all tables - tables_query = text( - """ + tables_query = text(""" SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' - """ - ) + """) tables = conn.execute(tables_query).fetchall() for (table_name,) in tables: # Get columns for each table - columns_query = text( - """ + columns_query = text(""" SELECT column_name, data_type FROM information_schema.columns WHERE table_name = :table_name ORDER BY ordinal_position - """ - ) + """) columns = conn.execute(columns_query, {"table_name": table_name}).fetchall() schema["tables"][table_name] = {"columns": [{"name": col, "type": dtype} for col, dtype in columns]} @@ -146,8 +142,7 @@ async def _get_product_inventory(self, sku: str, warehouse: str) -> Dict[str, An try: engine = self.get_engine() with engine.connect() as conn: - query = text( - """ + query = text(""" SELECT p.name as product, p.sku, @@ -159,8 +154,7 @@ async def _get_product_inventory(self, sku: str, warehouse: str) -> Dict[str, An JOIN products p ON i.product_id = p.id JOIN warehouses w ON i.warehouse_id = w.id WHERE p.sku = :sku AND w.name = :warehouse - """ - ) + """) result = conn.execute(query, {"sku": sku, "warehouse": warehouse}) row = result.fetchone() diff --git a/DocIndexRetriever/docker_compose/intel/cpu/xeon/config/milvus.yaml b/DocIndexRetriever/docker_compose/intel/cpu/xeon/config/milvus.yaml index b9f22cb3d1..8118a41ece 100644 --- a/DocIndexRetriever/docker_compose/intel/cpu/xeon/config/milvus.yaml +++ b/DocIndexRetriever/docker_compose/intel/cpu/xeon/config/milvus.yaml @@ -423,7 +423,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/DocIndexRetriever/docker_compose/intel/hpu/gaudi/config/milvus.yaml b/DocIndexRetriever/docker_compose/intel/hpu/gaudi/config/milvus.yaml index b9f22cb3d1..8118a41ece 100644 --- a/DocIndexRetriever/docker_compose/intel/hpu/gaudi/config/milvus.yaml +++ b/DocIndexRetriever/docker_compose/intel/hpu/gaudi/config/milvus.yaml @@ -423,7 +423,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/EdgeCraftRAG/docker_compose/intel/gpu/arc/milvus-config.yaml b/EdgeCraftRAG/docker_compose/intel/gpu/arc/milvus-config.yaml index b9f22cb3d1..8118a41ece 100755 --- a/EdgeCraftRAG/docker_compose/intel/gpu/arc/milvus-config.yaml +++ b/EdgeCraftRAG/docker_compose/intel/gpu/arc/milvus-config.yaml @@ -423,7 +423,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/EdgeCraftRAG/edgecraftrag/components/agents/deep_search/deep_search.py b/EdgeCraftRAG/edgecraftrag/components/agents/deep_search/deep_search.py index ada6713be1..5ef57ccb69 100644 --- a/EdgeCraftRAG/edgecraftrag/components/agents/deep_search/deep_search.py +++ b/EdgeCraftRAG/edgecraftrag/components/agents/deep_search/deep_search.py @@ -258,7 +258,9 @@ async def check_retrieved(self, state: DeepSearchState) -> str: bold=True, ), ) - await stream_writer(f"\n\n⚠️ **Reached maximum retrievals: {self.cfg.max_retrievals}, stopping search**\n\n") + await stream_writer( + f"\n\n⚠️ **Reached maximum retrievals: {self.cfg.max_retrievals}, stopping search**\n\n" + ) return "stop" response = await self.llm_generate_astream_writer(state.request) diff --git a/FinanceAgent/tools/research_tools.py b/FinanceAgent/tools/research_tools.py index f54527a3ee..1f38bd22c0 100644 --- a/FinanceAgent/tools/research_tools.py +++ b/FinanceAgent/tools/research_tools.py @@ -328,8 +328,7 @@ def analyze_balance_sheet( df_string = "Balance sheet:\n" + balance_sheet - instruction = dedent( - """ + instruction = dedent(""" Delve into a detailed scrutiny of the company's balance sheet for the most recent fiscal year, pinpointing the structure of assets, liabilities, and shareholders' equity to decode the firm's financial stability and operational efficiency. Focus on evaluating the liquidity through current assets versus current liabilities, @@ -337,8 +336,7 @@ def analyze_balance_sheet( Contrast these metrics with previous years' data to highlight financial trends, improvements, or deteriorations. Finalize with a strategic assessment of the company's financial leverage, asset management, and capital structure, providing insights into its fiscal health and future prospects in a single paragraph. Less than 130 words. - """ - ) + """) prompt = combine_prompt(instruction, df_string) return prompt @@ -365,8 +363,7 @@ def analyze_income_stmt( df_string = "Income statement:\n" + income_stmt # Analysis instruction - instruction = dedent( - """ + instruction = dedent(""" Conduct a comprehensive analysis of the company's income statement for the current fiscal year. Start with an overall revenue record, including Year-over-Year or Quarter-over-Quarter comparisons, and break down revenue sources to identify primary contributors and trends. Examine the Cost of @@ -377,8 +374,7 @@ def analyze_income_stmt( operational challenges. The output should be a strategic overview of the company’s financial health in a single paragraph, less than 130 words, summarizing the previous analysis into 4-5 key points under respective subheadings with specific discussion and strong data support. - """ - ) + """) # Combine the instruction, section text, and income statement prompt = combine_prompt(instruction, df_string) @@ -407,8 +403,7 @@ def analyze_cash_flow( df_string = "Cash flow statement:\n" + cash_flow - instruction = dedent( - """ + instruction = dedent(""" Dive into a comprehensive evaluation of the company's cash flow for the latest fiscal year, focusing on cash inflows and outflows across operating, investing, and financing activities. Examine the operational cash flow to assess the core business profitability, scrutinize investing activities for insights into capital expenditures and investments, @@ -416,8 +411,7 @@ def analyze_cash_flow( to prior periods to discern trends, sustainability, and liquidity risks. Conclude with an informed analysis of the company's cash management effectiveness, liquidity position, and potential for future growth or financial challenges in a single paragraph. Less than 130 words. - """ - ) + """) prompt = combine_prompt(instruction, df_string) return prompt @@ -457,12 +451,10 @@ def get_share_performance( df_string = "Past 60 days Stock prices:\n" + json.dumps(prices) - instruction = dedent( - """ + instruction = dedent(""" Dive into a comprehensive evaluation of the company's stock price for the latest 60 days. Less than 130 words. - """ - ) + """) prompt = combine_prompt(instruction, df_string) return prompt diff --git a/MultimodalQnA/docker_compose/amd/cpu/epyc/config/milvus.yaml b/MultimodalQnA/docker_compose/amd/cpu/epyc/config/milvus.yaml index 8d94d7e949..c06f482c52 100644 --- a/MultimodalQnA/docker_compose/amd/cpu/epyc/config/milvus.yaml +++ b/MultimodalQnA/docker_compose/amd/cpu/epyc/config/milvus.yaml @@ -425,7 +425,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/MultimodalQnA/docker_compose/intel/cpu/xeon/config/milvus.yaml b/MultimodalQnA/docker_compose/intel/cpu/xeon/config/milvus.yaml index b9f22cb3d1..8118a41ece 100644 --- a/MultimodalQnA/docker_compose/intel/cpu/xeon/config/milvus.yaml +++ b/MultimodalQnA/docker_compose/intel/cpu/xeon/config/milvus.yaml @@ -423,7 +423,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/MultimodalQnA/docker_compose/intel/hpu/gaudi/config/milvus.yaml b/MultimodalQnA/docker_compose/intel/hpu/gaudi/config/milvus.yaml index b9f22cb3d1..8118a41ece 100644 --- a/MultimodalQnA/docker_compose/intel/hpu/gaudi/config/milvus.yaml +++ b/MultimodalQnA/docker_compose/intel/hpu/gaudi/config/milvus.yaml @@ -423,7 +423,7 @@ dataCoord: balanceSilentDuration: 300 # The duration after which the channel manager start background channel balancing balanceInterval: 360 # The interval with which the channel manager check dml channel balance status checkInterval: 1 # The interval in seconds with which the channel manager advances channel states - notifyChannelOperationTimeout: 5 # Timeout notifing channel operations (in seconds). + notifyChannelOperationTimeout: 5 # Timeout notifying channel operations (in seconds). segment: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximum size of a segment in MB for collection which has Disk index diff --git a/MultimodalQnA/ui/gradio/utils.py b/MultimodalQnA/ui/gradio/utils.py index 7d2e386bdb..bb3433be92 100644 --- a/MultimodalQnA/ui/gradio/utils.py +++ b/MultimodalQnA/ui/gradio/utils.py @@ -105,7 +105,7 @@ def flush(self): def maintain_aspect_ratio_resize(image, width=None, height=None, inter=cv2.INTER_AREA): # Grab the image size and initialize dimensions dim = None - (h, w) = image.shape[:2] + h, w = image.shape[:2] # Return original image if no need to resize if width is None and height is None: diff --git a/one_click_deploy/core/deployer.py b/one_click_deploy/core/deployer.py index 4d3a6dc9fe..c385ffd1de 100644 --- a/one_click_deploy/core/deployer.py +++ b/one_click_deploy/core/deployer.py @@ -313,7 +313,7 @@ def _interactive_setup_for_deploy(self): # If this is an offline deployment, the mode is already set and should not be prompted. if getattr(self.args, "is_offline_deployment", False): - log_message("INFO", f"Offline Deployment Mode: {self.args.deploy_mode} (pre-selected)") + log_message("INFO", f"Offline Deployment Mode: {self.args.deploy_mode} (preselected)") else: self.args.deploy_mode = click.prompt( "Deployment Mode", type=click.Choice(["docker", "k8s"]), default="docker"