Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
"""
|
| 2 |
-
AURA Chat β Hedge Fund Picks (
|
| 3 |
Single-file Gradio app with:
|
| 4 |
- YouTube explainer video
|
| 5 |
- Info container (what it does, accuracy, example prompts)
|
| 6 |
-
-
|
| 7 |
-
-
|
|
|
|
| 8 |
"""
|
| 9 |
import os
|
| 10 |
import time
|
|
@@ -129,24 +130,33 @@ def continue_chat(chat_messages, user_message: str, analysis_text: str):
|
|
| 129 |
# =============================================================================
|
| 130 |
def build_demo():
|
| 131 |
with gr.Blocks(title="AURA Chat β Hedge Fund Picks") as demo:
|
| 132 |
-
#
|
| 133 |
gr.HTML("""
|
| 134 |
<style>
|
| 135 |
-
|
| 136 |
-
.
|
| 137 |
-
.
|
| 138 |
-
.
|
| 139 |
-
.
|
| 140 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
</style>
|
| 142 |
""")
|
| 143 |
-
|
|
|
|
|
|
|
| 144 |
gr.HTML("""
|
| 145 |
<div style="text-align:center; margin-bottom:20px;">
|
| 146 |
<iframe width="800" height="450" src="https://www.youtube.com/embed/56zpjyHd3d4"
|
| 147 |
title="AURA Chat Explainer" frameborder="0" allowfullscreen></iframe>
|
| 148 |
</div>
|
| 149 |
""")
|
|
|
|
| 150 |
# Info container
|
| 151 |
gr.HTML("""
|
| 152 |
<div class="info-box">
|
|
@@ -165,20 +175,21 @@ def build_demo():
|
|
| 165 |
Ranked top stock picks with short rationale, investment duration, and actionable insights.
|
| 166 |
</div>
|
| 167 |
""")
|
| 168 |
-
|
|
|
|
| 169 |
with gr.Row():
|
| 170 |
with gr.Column(scale=1):
|
| 171 |
prompts = gr.Textbox(lines=6, label="Data Prompts (one per line)", placeholder="Enter prompts here")
|
| 172 |
-
analyze_btn = gr.Button("Analyze"
|
| 173 |
error_box = gr.Markdown("", visible=False)
|
| 174 |
-
gr.Markdown(f"**Fixed settings:** Model = {LLM_MODEL} β’ Max tokens = {MAX_TOKENS} β’ Scrape delay = {SCRAPE_DELAY}s")
|
| 175 |
with gr.Column(scale=1):
|
| 176 |
analysis_out = gr.Textbox(label="Generated Analysis", lines=18, interactive=False)
|
| 177 |
gr.Markdown("**Chat with AURA about this analysis**")
|
| 178 |
chatbot = gr.Chatbot(height=420)
|
| 179 |
user_input = gr.Textbox(placeholder="Ask follow-up question...", label="Your question")
|
| 180 |
send_btn = gr.Button("Send")
|
| 181 |
-
|
| 182 |
analysis_state = gr.State("")
|
| 183 |
chat_state = gr.State([])
|
| 184 |
|
|
|
|
| 1 |
"""
|
| 2 |
+
AURA Chat β Hedge Fund Picks (Dark Mode + Enhanced UI)
|
| 3 |
Single-file Gradio app with:
|
| 4 |
- YouTube explainer video
|
| 5 |
- Info container (what it does, accuracy, example prompts)
|
| 6 |
+
- Dark theme (green, gray, black)
|
| 7 |
+
- Two-column layout: inputs left, analysis/chat right
|
| 8 |
+
- Interactive chat component
|
| 9 |
"""
|
| 10 |
import os
|
| 11 |
import time
|
|
|
|
| 130 |
# =============================================================================
|
| 131 |
def build_demo():
|
| 132 |
with gr.Blocks(title="AURA Chat β Hedge Fund Picks") as demo:
|
| 133 |
+
# Dark theme CSS
|
| 134 |
gr.HTML("""
|
| 135 |
<style>
|
| 136 |
+
body { background-color: #121212; color: #cfd8dc; font-family: Arial, sans-serif; }
|
| 137 |
+
.gradio-container { max-width: 1200px; margin: 20px auto; }
|
| 138 |
+
.info-box { background:#1e1e1e; border-left:4px solid #00ff66; border-radius:10px; padding:20px; margin-bottom:20px; }
|
| 139 |
+
.analysis-box { background:#1e1e1e; border-radius:10px; padding:15px; box-shadow:0 4px 14px rgba(0,255,102,0.2); color:#cfd8dc; overflow-y:auto; }
|
| 140 |
+
.section-title { font-size:20px; color:#00ff66; margin-bottom:8px; }
|
| 141 |
+
.example { background:#263238; padding:8px; border-radius:5px; font-family:monospace; color:#00ff66; }
|
| 142 |
+
.header-title { color:#00ff66; font-size:32px; font-weight:bold; margin-bottom:12px; text-align:center; }
|
| 143 |
+
.gr-button { background-color:#00ff66; color:#121212; border:none; }
|
| 144 |
+
.gr-button:hover { background-color:#00cc52; }
|
| 145 |
+
.chat-message-user { background:#263238; color:#cfd8dc; border-radius:8px; padding:8px; }
|
| 146 |
+
.chat-message-assistant { background:#00ff66; color:#121212; border-radius:8px; padding:8px; }
|
| 147 |
+
.textbox input, .textbox textarea { background:#1e1e1e; color:#cfd8dc; border:1px solid #00ff66; border-radius:5px; }
|
| 148 |
</style>
|
| 149 |
""")
|
| 150 |
+
gr.HTML('<div class="header-title">AURA Chat β Hedge Fund Picks</div>')
|
| 151 |
+
|
| 152 |
+
# YouTube explainer
|
| 153 |
gr.HTML("""
|
| 154 |
<div style="text-align:center; margin-bottom:20px;">
|
| 155 |
<iframe width="800" height="450" src="https://www.youtube.com/embed/56zpjyHd3d4"
|
| 156 |
title="AURA Chat Explainer" frameborder="0" allowfullscreen></iframe>
|
| 157 |
</div>
|
| 158 |
""")
|
| 159 |
+
|
| 160 |
# Info container
|
| 161 |
gr.HTML("""
|
| 162 |
<div class="info-box">
|
|
|
|
| 175 |
Ranked top stock picks with short rationale, investment duration, and actionable insights.
|
| 176 |
</div>
|
| 177 |
""")
|
| 178 |
+
|
| 179 |
+
# Two-column layout
|
| 180 |
with gr.Row():
|
| 181 |
with gr.Column(scale=1):
|
| 182 |
prompts = gr.Textbox(lines=6, label="Data Prompts (one per line)", placeholder="Enter prompts here")
|
| 183 |
+
analyze_btn = gr.Button("Analyze")
|
| 184 |
error_box = gr.Markdown("", visible=False)
|
| 185 |
+
gr.Markdown(f"**Fixed settings:** Model = {LLM_MODEL} β’ Max tokens = {MAX_TOKENS} β’ Scrape delay = {SCRAPE_DELAY}s", elem_classes="gr-mb-2")
|
| 186 |
with gr.Column(scale=1):
|
| 187 |
analysis_out = gr.Textbox(label="Generated Analysis", lines=18, interactive=False)
|
| 188 |
gr.Markdown("**Chat with AURA about this analysis**")
|
| 189 |
chatbot = gr.Chatbot(height=420)
|
| 190 |
user_input = gr.Textbox(placeholder="Ask follow-up question...", label="Your question")
|
| 191 |
send_btn = gr.Button("Send")
|
| 192 |
+
|
| 193 |
analysis_state = gr.State("")
|
| 194 |
chat_state = gr.State([])
|
| 195 |
|