chansung commited on
Commit
6f20169
β€’
1 Parent(s): 4b2f65c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -84,7 +84,7 @@ sorted_month = sorted(date_dict[last_year].keys())
84
  last_month = sorted_month[-1]
85
  sorted_day = sorted(date_dict[last_year][last_month].keys())
86
  last_day = sorted_day[-1]
87
- last_papers = date_dict[last_year][last_month][last_day]
88
  selected_paper = last_papers[0]
89
 
90
  def filter_function(example, ids):
@@ -252,6 +252,7 @@ def get_paper_by_year(y):
252
  d = sorted(date_dict[y][last_m].keys())
253
  last_d = d[-1]
254
  papers = [paper["title"] for paper in date_dict[y][last_m][last_d]]
 
255
  return (
256
  gr.Dropdown(choices=m, value=last_m),
257
  gr.Dropdown(choices=d, value=last_d),
@@ -262,6 +263,7 @@ def get_paper_by_month(y, m):
262
  d = sorted(date_dict[y][m].keys())
263
  last_d = d[-1]
264
  papers = [paper["title"] for paper in date_dict[y][m][last_d]]
 
265
  return (
266
  gr.Dropdown(choices=d, value=last_d),
267
  gr.Dropdown(choices=papers, value=papers[0])
@@ -269,6 +271,7 @@ def get_paper_by_month(y, m):
269
 
270
  def get_paper_by_day(y, m, d):
271
  papers = [paper["title"] for paper in date_dict[y][m][d]]
 
272
  return gr.Dropdown(choices=papers, value=papers[0])
273
 
274
  def set_paper(y, m, d, paper_title):
@@ -372,6 +375,7 @@ def set_date(title):
372
 
373
  def set_papers(y, m, d, title):
374
  papers = [paper["title"] for paper in date_dict[y][m][d]]
 
375
  return (
376
  gr.Dropdown(choices=papers, value=title),
377
  gr.Textbox("")
 
84
  last_month = sorted_month[-1]
85
  sorted_day = sorted(date_dict[last_year][last_month].keys())
86
  last_day = sorted_day[-1]
87
+ last_papers = list(set(date_dict[last_year][last_month][last_day]))
88
  selected_paper = last_papers[0]
89
 
90
  def filter_function(example, ids):
 
252
  d = sorted(date_dict[y][last_m].keys())
253
  last_d = d[-1]
254
  papers = [paper["title"] for paper in date_dict[y][last_m][last_d]]
255
+ papers = list(set(papers))
256
  return (
257
  gr.Dropdown(choices=m, value=last_m),
258
  gr.Dropdown(choices=d, value=last_d),
 
263
  d = sorted(date_dict[y][m].keys())
264
  last_d = d[-1]
265
  papers = [paper["title"] for paper in date_dict[y][m][last_d]]
266
+ papers = list(set(papers))
267
  return (
268
  gr.Dropdown(choices=d, value=last_d),
269
  gr.Dropdown(choices=papers, value=papers[0])
 
271
 
272
  def get_paper_by_day(y, m, d):
273
  papers = [paper["title"] for paper in date_dict[y][m][d]]
274
+ papers = list(set(papers))
275
  return gr.Dropdown(choices=papers, value=papers[0])
276
 
277
  def set_paper(y, m, d, paper_title):
 
375
 
376
  def set_papers(y, m, d, title):
377
  papers = [paper["title"] for paper in date_dict[y][m][d]]
378
+ papers = list(set(papers))
379
  return (
380
  gr.Dropdown(choices=papers, value=title),
381
  gr.Textbox("")