akhaliq HF staff commited on
Commit
6def03f
·
verified ·
1 Parent(s): ff07661

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -7,6 +7,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
7
  from huggingface_hub import HfApi
8
 
9
  import gradio as gr
 
10
 
11
  from datetime import timezone # Ensure timezone is imported
12
 
@@ -542,14 +543,8 @@ with demo:
542
  next_button.click(paper_manager.next_page, outputs=[paper_list])
543
 
544
  # Sort option change: Toggle visibility of time_frame_dropdown based on sort method
545
- def toggle_time_frame_visibility(sort_method):
546
- if sort_method.lower() == "top":
547
- return gr.update(visible=True)
548
- else:
549
- return gr.update(visible=False)
550
-
551
  sort_radio.change(
552
- fn=toggle_time_frame_visibility,
553
  inputs=[sort_radio],
554
  outputs=[time_frame_dropdown]
555
  )
@@ -573,4 +568,4 @@ with demo:
573
  # --- Launch the App ---
574
 
575
  if __name__ == "__main__":
576
- demo.launch()
 
7
  from huggingface_hub import HfApi
8
 
9
  import gradio as gr
10
+ import datasets # Added import for datasets
11
 
12
  from datetime import timezone # Ensure timezone is imported
13
 
 
543
  next_button.click(paper_manager.next_page, outputs=[paper_list])
544
 
545
  # Sort option change: Toggle visibility of time_frame_dropdown based on sort method
 
 
 
 
 
 
546
  sort_radio.change(
547
+ fn=lambda method: gr.update(visible=True) if method.lower() == "top" else gr.update(visible=False),
548
  inputs=[sort_radio],
549
  outputs=[time_frame_dropdown]
550
  )
 
568
  # --- Launch the App ---
569
 
570
  if __name__ == "__main__":
571
+ demo.launch()