Spaces:
Sleeping
Sleeping
jialicheng
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -115,16 +115,53 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
115 |
"""
|
116 |
current_year = datetime.datetime.now().year
|
117 |
|
118 |
-
demo = gr.Interface(
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
)
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
if __name__ == "__main__":
|
130 |
demo.launch()
|
|
|
115 |
"""
|
116 |
current_year = datetime.datetime.now().year
|
117 |
|
118 |
+
# demo = gr.Interface(
|
119 |
+
# search,
|
120 |
+
# inputs=[
|
121 |
+
# gr.Textbox(lines=2, placeholder="Keywords of the paper title. Supports ReGex."),
|
122 |
+
# gr.CheckboxGroup(["NeurIPS/ICLR/ICML", "*ACL", "CVPR/ECCV/ICCV"], label="Choose Venues to Search", value=["NeurIPS/ICLR/ICML", "*ACL", "CVPR/ECCV/ICCV"]),
|
123 |
+
# gr.Slider(minimum=2020, maximum=current_year, value=[2020, current_year], label="Year Range", step=1)
|
124 |
+
# ],
|
125 |
+
# outputs=gr.DataFrame(headers=["Paper Link", "Title", "Authors"])
|
126 |
+
# )
|
127 |
+
|
128 |
+
with gr.Blocks() as demo:
|
129 |
+
with gr.Row(): # Organize inputs and outputs in a row (side by side)
|
130 |
+
with gr.Column(scale=1): # Input section (narrower)
|
131 |
+
# Textbox for keywords
|
132 |
+
textbox = gr.Textbox(
|
133 |
+
label="Enter comma-separated keywords",
|
134 |
+
placeholder="Enter keywords, separated by commas...",
|
135 |
+
lines=2
|
136 |
+
)
|
137 |
+
# Vertical checkbox group for actions
|
138 |
+
checkbox = gr.CheckboxGroup(
|
139 |
+
["NeurIPS/ICLR/ICML", "*ACL", "CVPR/ECCV/ICCV"],
|
140 |
+
label="Choose Venues to Search",
|
141 |
+
value=["NeurIPS/ICLR/ICML", "*ACL", "CVPR/ECCV/ICCV"],
|
142 |
+
type="value"
|
143 |
+
)
|
144 |
+
# Year range slider
|
145 |
+
slider = gr.RangeSlider(
|
146 |
+
minimum=2020,
|
147 |
+
maximum=current_year,
|
148 |
+
value=[2020, current_year],
|
149 |
+
label="Year to Search",
|
150 |
+
step=1
|
151 |
+
)
|
152 |
+
with gr.Column(scale=3): # Output section (wider)
|
153 |
+
# Output table
|
154 |
+
output_table = gr.DataFrame(
|
155 |
+
headers=["Paper Link",],# "Title", "Authors"
|
156 |
+
label="Results"
|
157 |
+
)
|
158 |
+
|
159 |
+
# Link the input components to the output function
|
160 |
+
textbox.submit(
|
161 |
+
search,
|
162 |
+
inputs=[textbox, checkbox, slider],
|
163 |
+
outputs=output_table
|
164 |
+
)
|
165 |
|
166 |
if __name__ == "__main__":
|
167 |
demo.launch()
|