hysts HF staff commited on
Commit
8c0737d
1 Parent(s): b5de4af
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -1,5 +1,7 @@
1
  #!/usr/bin/env python
2
 
 
 
3
  import gradio as gr
4
  import pandas as pd
5
  from apscheduler.schedulers.background import BackgroundScheduler
@@ -38,6 +40,16 @@ def update_num_papers(df: pd.DataFrame) -> str:
38
  return f"{len(df)} / {len(paper_list.df_raw)}"
39
 
40
 
 
 
 
 
 
 
 
 
 
 
41
  with gr.Blocks(css="style.css") as demo:
42
  gr.Markdown(DESCRIPTION)
43
  with gr.Group():
@@ -77,7 +89,7 @@ with gr.Blocks(css="style.css") as demo:
77
 
78
  gr.on(
79
  triggers=[start_date.change, end_date.change, search_title.submit, search_abstract.submit],
80
- fn=paper_list.search,
81
  inputs=[start_date, end_date, search_title, search_abstract, max_num_to_retrieve],
82
  outputs=df,
83
  api_name=False,
 
1
  #!/usr/bin/env python
2
 
3
+ import datetime
4
+
5
  import gradio as gr
6
  import pandas as pd
7
  from apscheduler.schedulers.background import BackgroundScheduler
 
40
  return f"{len(df)} / {len(paper_list.df_raw)}"
41
 
42
 
43
+ def search(
44
+ start_date: datetime.datetime,
45
+ end_date: datetime.datetime,
46
+ search_title: str,
47
+ search_abstract: str,
48
+ max_num_to_retrieve: int,
49
+ ) -> pd.DataFrame:
50
+ return paper_list.search(start_date, end_date, search_title, search_abstract, max_num_to_retrieve)
51
+
52
+
53
  with gr.Blocks(css="style.css") as demo:
54
  gr.Markdown(DESCRIPTION)
55
  with gr.Group():
 
89
 
90
  gr.on(
91
  triggers=[start_date.change, end_date.change, search_title.submit, search_abstract.submit],
92
+ fn=search,
93
  inputs=[start_date, end_date, search_title, search_abstract, max_num_to_retrieve],
94
  outputs=df,
95
  api_name=False,