Spaces:
Running
Running
QAway-to
commited on
Commit
·
4948018
1
Parent(s):
eb2bf76
New style APP+
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
from services.llm_client import llm_service
|
| 3 |
from core.analyzer import PortfolioAnalyzer
|
| 4 |
from core.comparer import PortfolioComparer
|
|
@@ -62,13 +64,13 @@ h2, h3, .gr-markdown {
|
|
| 62 |
lines=1,
|
| 63 |
)
|
| 64 |
analyze_button = gr.Button("Run Analysis", variant="primary")
|
| 65 |
-
analyze_output = gr.Textbox(label="Analysis Result", lines=15)
|
| 66 |
analyze_button.click(fn=analyzer.run, inputs=portfolio_input, outputs=analyze_output)
|
| 67 |
|
| 68 |
# --- Comparison Tab ---
|
| 69 |
with gr.TabItem("Comparison"):
|
| 70 |
-
compare_input_1 = gr.Textbox(label="Portfolio A")
|
| 71 |
-
compare_input_2 = gr.Textbox(label="Portfolio B")
|
| 72 |
compare_button = gr.Button("Compare Portfolios", variant="primary")
|
| 73 |
compare_output = gr.Textbox(label="Comparison Result", lines=20)
|
| 74 |
compare_button.click(fn=comparer.run, inputs=[compare_input_1, compare_input_2], outputs=compare_output)
|
|
@@ -82,7 +84,7 @@ h2, h3, .gr-markdown {
|
|
| 82 |
|
| 83 |
# --- Metrics Table Tab ---
|
| 84 |
with gr.TabItem("Metrics Table"):
|
| 85 |
-
metrics_input = gr.Textbox(label="Portfolio ID")
|
| 86 |
metrics_button = gr.Button("Load Metrics", variant="primary")
|
| 87 |
metrics_output = gr.Dataframe(label="Portfolio Metrics", wrap=True)
|
| 88 |
metrics_button.click(fn=show_metrics_table, inputs=metrics_input, outputs=metrics_output)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from tomlkit import value
|
| 3 |
+
|
| 4 |
from services.llm_client import llm_service
|
| 5 |
from core.analyzer import PortfolioAnalyzer
|
| 6 |
from core.comparer import PortfolioComparer
|
|
|
|
| 64 |
lines=1,
|
| 65 |
)
|
| 66 |
analyze_button = gr.Button("Run Analysis", variant="primary")
|
| 67 |
+
analyze_output = gr.Textbox(label="Analysis Result", lines=15, value='3852a354-e66e-4bc5-97e9-55124e31e687')
|
| 68 |
analyze_button.click(fn=analyzer.run, inputs=portfolio_input, outputs=analyze_output)
|
| 69 |
|
| 70 |
# --- Comparison Tab ---
|
| 71 |
with gr.TabItem("Comparison"):
|
| 72 |
+
compare_input_1 = gr.Textbox(label="Portfolio A", value='3852a354-e66e-4bc5-97e9-55124e31e687')
|
| 73 |
+
compare_input_2 = gr.Textbox(label="Portfolio B", value='b1ef37aa-5b9a-41b4-9394-8823f2de36bb')
|
| 74 |
compare_button = gr.Button("Compare Portfolios", variant="primary")
|
| 75 |
compare_output = gr.Textbox(label="Comparison Result", lines=20)
|
| 76 |
compare_button.click(fn=comparer.run, inputs=[compare_input_1, compare_input_2], outputs=compare_output)
|
|
|
|
| 84 |
|
| 85 |
# --- Metrics Table Tab ---
|
| 86 |
with gr.TabItem("Metrics Table"):
|
| 87 |
+
metrics_input = gr.Textbox(label="Portfolio ID", value='b1ef37aa-5b9a-41b4-9394-8823f2de36bb')
|
| 88 |
metrics_button = gr.Button("Load Metrics", variant="primary")
|
| 89 |
metrics_output = gr.Dataframe(label="Portfolio Metrics", wrap=True)
|
| 90 |
metrics_button.click(fn=show_metrics_table, inputs=metrics_input, outputs=metrics_output)
|