VectorV17 commited on
Commit
1316e6a
·
verified ·
1 Parent(s): 35efcc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -143,7 +143,7 @@ def respond(
143
  yield "", updated_history
144
 
145
  # Initialize customizable custom-themed layout frame
146
- with gr.Blocks() as demo:
147
 
148
  # Top Control and Info Strip
149
  with gr.Row():
@@ -155,8 +155,7 @@ with gr.Blocks() as demo:
155
  theme_toggle = gr.Button("🌙 Dark Mode", elem_classes=["toggle-btn"])
156
 
157
  # Automatically refresh time indicator string every 1 second
158
- timer = gr.Timer(1.0)
159
- timer.tick(fn=update_timestamp, outputs=timestamp_box)
160
 
161
  # JavaScript logic binding for the Theme Toggle Switch
162
  theme_toggle.click(
@@ -226,4 +225,4 @@ with gr.Blocks() as demo:
226
  clear_btn.click(fn=lambda: [], outputs=chatbot)
227
 
228
  if __name__ == "__main__":
229
- demo.launch(css=CUSTOM_CSS, theme=gr.themes.Soft())
 
143
  yield "", updated_history
144
 
145
  # Initialize customizable custom-themed layout frame
146
+ with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
147
 
148
  # Top Control and Info Strip
149
  with gr.Row():
 
155
  theme_toggle = gr.Button("🌙 Dark Mode", elem_classes=["toggle-btn"])
156
 
157
  # Automatically refresh time indicator string every 1 second
158
+ demo.load(fn=update_timestamp, outputs=timestamp_box, every=1.0)
 
159
 
160
  # JavaScript logic binding for the Theme Toggle Switch
161
  theme_toggle.click(
 
225
  clear_btn.click(fn=lambda: [], outputs=chatbot)
226
 
227
  if __name__ == "__main__":
228
+ demo.launch()