roll-ai commited on
Commit
23146cc
Β·
verified Β·
1 Parent(s): 99da118

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -142,9 +142,8 @@ video_interface = gr.Interface(
142
  title="πŸŽ₯ FloVD: Optical Flow + CogVideoX Video Generation",
143
  description="Upload an image and prompt to generate motion-controlled video using FloVD and CogVideoX."
144
  )
145
-
146
  # =========================================
147
- # 4. Live System Monitor
148
  # =========================================
149
 
150
  def get_system_stats():
@@ -170,7 +169,12 @@ def get_system_stats():
170
  with gr.Blocks() as monitor_tab:
171
  gr.Markdown("## πŸ“Š Live System Resource Monitor")
172
  stats_box = gr.Textbox(label="Live Stats", lines=10, interactive=False)
173
- gr.Live(stats_box.update, fn=get_system_stats, every=2.0)
 
 
 
 
 
174
 
175
  # =========================================
176
  # 5. Combine Tabs: FloVD + Monitor
 
142
  title="πŸŽ₯ FloVD: Optical Flow + CogVideoX Video Generation",
143
  description="Upload an image and prompt to generate motion-controlled video using FloVD and CogVideoX."
144
  )
 
145
  # =========================================
146
+ # 4. Live System Monitor (Fixed)
147
  # =========================================
148
 
149
  def get_system_stats():
 
169
  with gr.Blocks() as monitor_tab:
170
  gr.Markdown("## πŸ“Š Live System Resource Monitor")
171
  stats_box = gr.Textbox(label="Live Stats", lines=10, interactive=False)
172
+
173
+ def update_stats():
174
+ return gr.update(value=get_system_stats())
175
+
176
+ stats_btn = gr.Button("πŸ”„ Refresh Stats")
177
+ stats_btn.click(fn=update_stats, outputs=stats_box)
178
 
179
  # =========================================
180
  # 5. Combine Tabs: FloVD + Monitor