Spaces:
Running
Running
update gradio UI
Browse files
app.py
CHANGED
|
@@ -230,24 +230,26 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as app:
|
|
| 230 |
)
|
| 231 |
|
| 232 |
run_button = gr.Button("π Run Full Analysis", variant="primary")
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
report_output = gr.Markdown(label="π Intelligence Report")
|
| 235 |
|
| 236 |
-
def analyze_crypto(crypto, currency, days):
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
spinner_html = "<p>β
<b>Complete!</b></p>"
|
| 242 |
-
return spinner_html, report
|
| 243 |
-
except Exception as e:
|
| 244 |
-
spinner_html = f"<p>β Error: {e}</p>"
|
| 245 |
-
return spinner_html, "An error occurred during analysis."
|
| 246 |
|
| 247 |
run_button.click(
|
| 248 |
analyze_crypto,
|
| 249 |
inputs=[crypto, currency, days],
|
| 250 |
-
outputs=[
|
| 251 |
show_progress=True
|
| 252 |
)
|
| 253 |
|
|
|
|
| 230 |
)
|
| 231 |
|
| 232 |
run_button = gr.Button("π Run Full Analysis", variant="primary")
|
| 233 |
+
|
| 234 |
+
# Add a simple status box to show "Complete!" text
|
| 235 |
+
status_box = gr.Textbox(
|
| 236 |
+
label="Status",
|
| 237 |
+
value="Idle",
|
| 238 |
+
interactive=False,
|
| 239 |
+
)
|
| 240 |
+
|
| 241 |
report_output = gr.Markdown(label="π Intelligence Report")
|
| 242 |
|
| 243 |
+
def analyze_crypto(crypto, currency, days, progress=gr.Progress(track_tqdm=True)):
|
| 244 |
+
progress(0, desc="Starting analysis...")
|
| 245 |
+
report = generate_report(crypto, currency, days)
|
| 246 |
+
progress(1, desc="Analysis complete!")
|
| 247 |
+
return "β
Analysis Complete!", report
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
|
| 249 |
run_button.click(
|
| 250 |
analyze_crypto,
|
| 251 |
inputs=[crypto, currency, days],
|
| 252 |
+
outputs=[status_box, report_output],
|
| 253 |
show_progress=True
|
| 254 |
)
|
| 255 |
|