Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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))$
Expand All @@ -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)$
Expand Down Expand Up @@ -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

Expand All @@ -99,30 +99,30 @@ 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]
additional_dependencies:
- black==24.10.0

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
args: [-w]
additional_dependencies:
- 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]
24 changes: 8 additions & 16 deletions AvatarChatbot/ui/gradio/app_gradio_demo_avatarchatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,10 @@ def initial_process(audio_input, face_input, model_choice):
gr.Markdown("<h1 style='font-size: 36px;'>A PyTorch and OPEA based AI Avatar Audio Chatbot</h1>")
with gr.Row():
with gr.Column(scale=8):
gr.Markdown(
"""
gr.Markdown("""
<p style='font-size: 24px;'>Welcome to our AI Avatar Audio Chatbot! This application leverages PyTorch and <strong>OPEA (Open Platform for Enterprise AI) v0.8</strong> 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.<br>
Please feel free to interact with the AI avatar by choosing your own avatar and talking into the mic.</p>
"""
)
""")
with gr.Column(scale=1):
# with gr.Row():
# gr.Markdown(f"""
Expand Down Expand Up @@ -285,8 +283,7 @@ def initial_process(audio_input, face_input, model_choice):
# Technical details
gr.Markdown("<hr>") # Divider
with gr.Row():
gr.Markdown(
"""
gr.Markdown("""
<p style='font-size: 24px;'>OPEA megaservice deployed: <br>
<ul style='font-size: 24px;'>
<li><strong>AvatarChatbot</strong></li>
Expand All @@ -298,33 +295,28 @@ def initial_process(audio_input, face_input, model_choice):
<li><strong>TTS</strong> (service: opea/speecht5-gaudi, model: microsoft/speecht5_tts)</li>
<li><strong>Animation</strong> (service: opea/animation, model: wav2lip+gfpgan)</li>
</ul></p>
"""
)
""")
with gr.Row():
gr.Image("assets/img/flowchart.png", label="Megaservice Flowchart")
with gr.Row():
gr.Markdown(
"""
gr.Markdown("""
<p style='font-size: 24px;'>The AI Avatar Audio Chatbot is powered by the following Intel® AI software:<br>
<ul style='font-size: 24px;'>
<li><strong>Intel Gaudi Software v1.17.0</strong></li>
<li><strong>PyTorch v2.3.1 (Eager mode + torch.compile) </strong></li>
<li><strong>HPU Graph</strong></li>
<li><strong>Intel Neural Compressor (INC)</strong></li>
</ul></p>
"""
)
""")

# Disclaimer
gr.Markdown("<hr>") # Divider
gr.Markdown("<h2 style='font-size: 24px;'>Notices & Disclaimers</h1>")
gr.Markdown(
"""
gr.Markdown("""
<p style='font-size: 20px;'>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.<br></p>
<p style='font-size: 20px;'>© 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.<br></p>
<p style='font-size: 20px;'>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.<br></p>
"""
)
""")

# State transitions
# for i in range(len(image_pils)):
Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/docker_compose/amd/cpu/epyc/milvus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/docker_compose/intel/cpu/xeon/milvus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 6 additions & 12 deletions CogniwareIms/backend/app/services/dbqna_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand Down Expand Up @@ -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,
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 8 additions & 16 deletions FinanceAgent/tools/research_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,15 @@ 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,
the solvency via long-term debt ratios, and the equity position to gauge long-term investment potential.
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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -407,17 +403,15 @@ 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,
and review financing activities to understand debt, equity movements, and dividend policies. Compare these cash movements
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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MultimodalQnA/ui/gradio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion one_click_deploy/core/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading