Tonic commited on
Commit
4ac6687
·
unverified ·
1 Parent(s): 55ce26a

fix gradio display issue

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1036,7 +1036,7 @@ def make_prediction_enhanced(symbol: str, timeframe: str = "1d", prediction_days
1036
  pipe = load_pipeline()
1037
 
1038
  # Get the model's device and dtype
1039
- device = torch.device("cuda:0") # Force CUDA device
1040
  dtype = torch.float16 # Force float16
1041
  print(f"Model device: {device}")
1042
  print(f"Model dtype: {dtype}")
@@ -2642,9 +2642,15 @@ def create_interface():
2642
 
2643
  # Add market status message with periodic updates
2644
  market_status_display = gr.Markdown(
2645
- value=get_market_status_display(),
2646
- every=600, # Update every 10 minutes (600 seconds)
2647
- fn=update_market_status
 
 
 
 
 
 
2648
  )
2649
 
2650
  # Add enhanced market information section
 
1036
  pipe = load_pipeline()
1037
 
1038
  # Get the model's device and dtype
1039
+ device = torch.device("cuda:0") # Force CUDA device mapping
1040
  dtype = torch.float16 # Force float16
1041
  print(f"Model device: {device}")
1042
  print(f"Model dtype: {dtype}")
 
2642
 
2643
  # Add market status message with periodic updates
2644
  market_status_display = gr.Markdown(
2645
+ value=get_market_status_display()
2646
+ )
2647
+
2648
+ # Set up periodic updates for market status
2649
+ market_status_display.every(
2650
+ fn=update_market_status,
2651
+ inputs=None,
2652
+ outputs=market_status_display,
2653
+ every=600 # Update every 10 minutes (600 seconds)
2654
  )
2655
 
2656
  # Add enhanced market information section