Spaces:
Running
Running
jbdel
commited on
Commit
•
6f74be6
1
Parent(s):
5cb0697
add COLM + conference param
Browse files- app.py +9 -4
- constants.py +2 -0
- df/PaperCentral.py +2 -1
app.py
CHANGED
@@ -374,6 +374,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
374 |
str: The echoed text.
|
375 |
"""
|
376 |
calendar = gr.update()
|
|
|
377 |
|
378 |
if request:
|
379 |
print("Request headers dictionary:", dict(request.headers))
|
@@ -382,10 +383,14 @@ with gr.Blocks(css="style.css") as demo:
|
|
382 |
print("Session hash:", request.session_hash)
|
383 |
if 'date' in request.query_params:
|
384 |
calendar = gr.update(value=request.query_params['date'])
|
385 |
-
if '
|
386 |
-
|
|
|
|
|
|
|
|
|
387 |
|
388 |
-
return calendar
|
389 |
|
390 |
|
391 |
demo.load(
|
@@ -395,7 +400,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
395 |
api_name=False,
|
396 |
).then(
|
397 |
fn=echo,
|
398 |
-
outputs=[calendar]
|
399 |
)
|
400 |
|
401 |
|
|
|
374 |
str: The echoed text.
|
375 |
"""
|
376 |
calendar = gr.update()
|
377 |
+
conferences = gr.update()
|
378 |
|
379 |
if request:
|
380 |
print("Request headers dictionary:", dict(request.headers))
|
|
|
383 |
print("Session hash:", request.session_hash)
|
384 |
if 'date' in request.query_params:
|
385 |
calendar = gr.update(value=request.query_params['date'])
|
386 |
+
if 'conferences' in request.query_params:
|
387 |
+
conferences = request.query_params['conferences']
|
388 |
+
try:
|
389 |
+
conferences = [value for value in conferences.split(',')]
|
390 |
+
except ValueError:
|
391 |
+
conferences = []
|
392 |
|
393 |
+
return calendar, conferences
|
394 |
|
395 |
|
396 |
demo.load(
|
|
|
400 |
api_name=False,
|
401 |
).then(
|
402 |
fn=echo,
|
403 |
+
outputs=[calendar, conference_options]
|
404 |
)
|
405 |
|
406 |
|
constants.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
NEURIPS_ICO = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAeFBMVEVHcExoRIuHYZ5oRItoRItoRItoRItoRItSN2loRItoRIuDXpxoRItoRIuSbKWRa6SRa6QCAAsAAAAAAAAAAAAAAAAAAAAAAAAAAACRa6SRa6QAAAAAAAAAAACRa6SRa6SRa6QAAAAAAAAAAACRa6QAAACRa6SRa6TWTNGBAAAAKHRSTlMAQBVQ9mKR0AgzfiGvcypL4BBmP11VbIQvd5JKcSFaOv95io2qjsjs/SKIogAAAT9JREFUeAHMwbUBAzAMBMB/C2wLAvsvmyYMfe7wZ8gh+E3Np6lMfLV0h+bwHFLEJ90lEFGZvcUcH6ayIri5ucLF8Iq6AZl0aROAKcSzw8G3NFYJbohnx+3Ybbbxw+msBHJfqp2DHAdhGAqgX1khRSKY2GAwJtBhOve/4aTNoisO0GfJ9srfGDOLYGKaSfGxpBWNbVtmr20cDR9xL6iydpp9ooncoCKZjNRRHf0eOkBsPI3xOPVnlhlmjG0WVDEMJQLmnuHmlMndO8+v3dqFUK6AipjFTUXZXyWiag5g2VO5egA+8cZgwekmWSz/TmTAMqThwrD26PA+zLzZWOdJhEwAwrPfhxLCAZjpaIY8+eMUIzTLMy7laiECVYaKqrf85u/CuuOIuLOGNSUUpB53jvpFisOFe8d+rCHgXkQK+Fb/W30Y/tu4vyAAAAAASUVORK5CYII="
|
2 |
COLM_ICO = "data:image/svg+xml;base64,PCEtLSBmYXZpY29uLnN2ZyAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDx0ZXh0IHk9IjMyIiBmb250LXNpemU9IjMyIj7wn6aZPC90ZXh0Pgo8L3N2Zz4="
|
|
|
|
|
3 |
DATASET_ARXIV_SCAN_PAPERS = "IAMJB/scanned-arxiv-papers-id"
|
4 |
DATASET_CONFERENCE_PAPERS = "IAMJB/paper_conference_aggregate"
|
5 |
DATASET_DAILY_PAPERS = "hysts-bot-data/daily-papers"
|
|
|
1 |
NEURIPS_ICO = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAeFBMVEVHcExoRIuHYZ5oRItoRItoRItoRItoRItSN2loRItoRIuDXpxoRItoRIuSbKWRa6SRa6QCAAsAAAAAAAAAAAAAAAAAAAAAAAAAAACRa6SRa6QAAAAAAAAAAACRa6SRa6SRa6QAAAAAAAAAAACRa6QAAACRa6SRa6TWTNGBAAAAKHRSTlMAQBVQ9mKR0AgzfiGvcypL4BBmP11VbIQvd5JKcSFaOv95io2qjsjs/SKIogAAAT9JREFUeAHMwbUBAzAMBMB/C2wLAvsvmyYMfe7wZ8gh+E3Np6lMfLV0h+bwHFLEJ90lEFGZvcUcH6ayIri5ucLF8Iq6AZl0aROAKcSzw8G3NFYJbohnx+3Ybbbxw+msBHJfqp2DHAdhGAqgX1khRSKY2GAwJtBhOve/4aTNoisO0GfJ9srfGDOLYGKaSfGxpBWNbVtmr20cDR9xL6iydpp9ooncoCKZjNRRHf0eOkBsPI3xOPVnlhlmjG0WVDEMJQLmnuHmlMndO8+v3dqFUK6AipjFTUXZXyWiag5g2VO5egA+8cZgwekmWSz/TmTAMqThwrD26PA+zLzZWOdJhEwAwrPfhxLCAZjpaIY8+eMUIzTLMy7laiECVYaKqrf85u/CuuOIuLOGNSUUpB53jvpFisOFe8d+rCHgXkQK+Fb/W30Y/tu4vyAAAAAASUVORK5CYII="
|
2 |
COLM_ICO = "data:image/svg+xml;base64,PCEtLSBmYXZpY29uLnN2ZyAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDx0ZXh0IHk9IjMyIiBmb250LXNpemU9IjMyIj7wn6aZPC90ZXh0Pgo8L3N2Zz4="
|
3 |
+
DEFAULT_ICO = NEURIPS_ICO
|
4 |
+
|
5 |
DATASET_ARXIV_SCAN_PAPERS = "IAMJB/scanned-arxiv-papers-id"
|
6 |
DATASET_CONFERENCE_PAPERS = "IAMJB/paper_conference_aggregate"
|
7 |
DATASET_DAILY_PAPERS = "hysts-bot-data/daily-papers"
|
df/PaperCentral.py
CHANGED
@@ -7,6 +7,7 @@ from constants import (
|
|
7 |
NEURIPS_ICO,
|
8 |
DATASET_PAPER_CENTRAL,
|
9 |
COLM_ICO,
|
|
|
10 |
)
|
11 |
import gradio as gr
|
12 |
from utils import load_and_process
|
@@ -213,7 +214,7 @@ class PaperCentral:
|
|
213 |
)
|
214 |
|
215 |
if 'proceedings' in row and pd.notna(row['proceedings']) and row['proceedings']:
|
216 |
-
image_url = PaperCentral.CONFERENCES_ICONS
|
217 |
|
218 |
style = "display:inline-block; vertical-align:middle; width: 16px; height:16px"
|
219 |
row['proceedings'] = (
|
|
|
7 |
NEURIPS_ICO,
|
8 |
DATASET_PAPER_CENTRAL,
|
9 |
COLM_ICO,
|
10 |
+
DEFAULT_ICO,
|
11 |
)
|
12 |
import gradio as gr
|
13 |
from utils import load_and_process
|
|
|
214 |
)
|
215 |
|
216 |
if 'proceedings' in row and pd.notna(row['proceedings']) and row['proceedings']:
|
217 |
+
image_url = PaperCentral.CONFERENCES_ICONS.get(row["conference_name"], DEFAULT_ICO)
|
218 |
|
219 |
style = "display:inline-block; vertical-align:middle; width: 16px; height:16px"
|
220 |
row['proceedings'] = (
|