cicboy commited on
Commit
b5be632
Β·
1 Parent(s): 8b85e2d

update gradio UI

Browse files
Files changed (1) hide show
  1. app.py +14 -12
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
- spinner = gr.HTML("")
 
 
 
 
 
 
 
234
  report_output = gr.Markdown(label="πŸ“Š Intelligence Report")
235
 
236
- def analyze_crypto(crypto, currency, days):
237
- spinner_html = "<p> ⏳ <b>Running...</b></p>"
238
- time.sleep(0.5)
239
- try:
240
- report = generate_report(crypto, currency, days)
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=[spinner, report_output],
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