SushantGautam commited on
Commit
1c51e2c
·
1 Parent(s): a4c4098

Update display_submissions to return Gradio update and make output_table non-interactive

Browse files
Files changed (1) hide show
  1. gradio_interface.py +3 -3
gradio_interface.py CHANGED
@@ -68,7 +68,7 @@ def display_submissions(task_type="all", search_query=""):
68
  refresh_submissions()
69
  print("Displaying submissions...", submissions)
70
  filtered_submissions = filter_submissions(task_type, search_query)
71
- return [[s["user"], s["task"], s["submitted_time"]] for s in filtered_submissions]
72
 
73
 
74
  def add_submission(file):
@@ -104,8 +104,8 @@ def refresh_page():
104
 
105
 
106
  # Define Gradio interface components
107
- output_table = gr.Dataframe(
108
- headers=["User", "Task", "Submitted Time"], value=display_submissions(), scale=5,)
109
  task_type_dropdown = gr.Dropdown(
110
  choices=["all", "task1", "task2"], value="all", label="Task Type")
111
  search_box = gr.Textbox(value="", label="Search User")
 
68
  refresh_submissions()
69
  print("Displaying submissions...", submissions)
70
  filtered_submissions = filter_submissions(task_type, search_query)
71
+ return gr.update(value=[[s["user"], s["task"], s["submitted_time"]] for s in filtered_submissions])
72
 
73
 
74
  def add_submission(file):
 
104
 
105
 
106
  # Define Gradio interface components
107
+ output_table = gr.Dataframe(headers=[
108
+ "User", "Task", "Submitted Time"], interactive=False, value=display_submissions(), scale=5,)
109
  task_type_dropdown = gr.Dropdown(
110
  choices=["all", "task1", "task2"], value="all", label="Task Type")
111
  search_box = gr.Textbox(value="", label="Search User")