VectorV17 commited on
Commit
6aca1ad
·
verified ·
1 Parent(s): 1d4a770

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
147
 
148
  # Top Control and Info Strip
149
  with gr.Row():
@@ -155,7 +155,8 @@ with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
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,4 +226,4 @@ with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
225
  clear_btn.click(fn=lambda: [], outputs=chatbot)
226
 
227
  if __name__ == "__main__":
228
- demo.launch()
 
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
  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
  clear_btn.click(fn=lambda: [], outputs=chatbot)
227
 
228
  if __name__ == "__main__":
229
+ demo.launch(css=CUSTOM_CSS, theme=gr.themes.Soft())