Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,7 @@ class Prettifier:
|
|
95 |
new_rows = []
|
96 |
for _, row in df.iterrows():
|
97 |
new_row = {
|
|
|
98 |
"date": Prettifier.create_link(row.date, f"https://huggingface.co/papers?date={row.date}"),
|
99 |
"paper_page": Prettifier.create_link(row.arxiv_id, row.paper_page),
|
100 |
"title": row["title"],
|
@@ -108,6 +109,7 @@ class Prettifier:
|
|
108 |
|
109 |
class PaperList:
|
110 |
COLUMN_INFO = [
|
|
|
111 |
["date", "markdown"],
|
112 |
["paper_page", "markdown"],
|
113 |
["title", "str"],
|
@@ -176,8 +178,8 @@ class PaperManager:
|
|
176 |
self.papers_per_page = papers_per_page
|
177 |
self.current_page = 1
|
178 |
self.sort_method = "hot" # Default sort method
|
179 |
-
self.total_pages = max((len(self.paper_list.df_raw) + self.papers_per_page - 1) // self.papers_per_page, 1)
|
180 |
self.sort_papers()
|
|
|
181 |
|
182 |
def calculate_score(self, row):
|
183 |
"""
|
@@ -486,6 +488,7 @@ table {
|
|
486 |
}
|
487 |
"""
|
488 |
|
|
|
489 |
# --- Initialize Gradio Blocks ---
|
490 |
|
491 |
demo = gr.Blocks(css=css)
|
@@ -500,7 +503,6 @@ with demo:
|
|
500 |
|
501 |
Once your paper is submitted, it will automatically appear in this demo.
|
502 |
""")
|
503 |
-
|
504 |
# Header with Refresh Button
|
505 |
with gr.Row():
|
506 |
gr.HTML("""
|
@@ -517,7 +519,6 @@ with demo:
|
|
517 |
</tr>
|
518 |
</table>
|
519 |
""")
|
520 |
-
|
521 |
# Sort Options
|
522 |
with gr.Row():
|
523 |
sort_radio = gr.Radio(
|
@@ -526,10 +527,8 @@ with demo:
|
|
526 |
label="Sort By",
|
527 |
interactive=True
|
528 |
)
|
529 |
-
|
530 |
# Paper list
|
531 |
paper_list = gr.HTML()
|
532 |
-
|
533 |
# Navigation Buttons
|
534 |
with gr.Row():
|
535 |
prev_button = gr.Button("Prev")
|
@@ -576,4 +575,4 @@ with demo:
|
|
576 |
# --- Launch the App ---
|
577 |
|
578 |
if __name__ == "__main__":
|
579 |
-
demo.launch()
|
|
|
95 |
new_rows = []
|
96 |
for _, row in df.iterrows():
|
97 |
new_row = {
|
98 |
+
"arxiv_id": row["arxiv_id"], # Include arxiv_id
|
99 |
"date": Prettifier.create_link(row.date, f"https://huggingface.co/papers?date={row.date}"),
|
100 |
"paper_page": Prettifier.create_link(row.arxiv_id, row.paper_page),
|
101 |
"title": row["title"],
|
|
|
109 |
|
110 |
class PaperList:
|
111 |
COLUMN_INFO = [
|
112 |
+
["arxiv_id", "str"], # Added arxiv_id
|
113 |
["date", "markdown"],
|
114 |
["paper_page", "markdown"],
|
115 |
["title", "str"],
|
|
|
178 |
self.papers_per_page = papers_per_page
|
179 |
self.current_page = 1
|
180 |
self.sort_method = "hot" # Default sort method
|
|
|
181 |
self.sort_papers()
|
182 |
+
self.total_pages = max((len(self.paper_list.df_raw) + self.papers_per_page - 1) // self.papers_per_page, 1)
|
183 |
|
184 |
def calculate_score(self, row):
|
185 |
"""
|
|
|
488 |
}
|
489 |
"""
|
490 |
|
491 |
+
|
492 |
# --- Initialize Gradio Blocks ---
|
493 |
|
494 |
demo = gr.Blocks(css=css)
|
|
|
503 |
|
504 |
Once your paper is submitted, it will automatically appear in this demo.
|
505 |
""")
|
|
|
506 |
# Header with Refresh Button
|
507 |
with gr.Row():
|
508 |
gr.HTML("""
|
|
|
519 |
</tr>
|
520 |
</table>
|
521 |
""")
|
|
|
522 |
# Sort Options
|
523 |
with gr.Row():
|
524 |
sort_radio = gr.Radio(
|
|
|
527 |
label="Sort By",
|
528 |
interactive=True
|
529 |
)
|
|
|
530 |
# Paper list
|
531 |
paper_list = gr.HTML()
|
|
|
532 |
# Navigation Buttons
|
533 |
with gr.Row():
|
534 |
prev_button = gr.Button("Prev")
|
|
|
575 |
# --- Launch the App ---
|
576 |
|
577 |
if __name__ == "__main__":
|
578 |
+
demo.launch()
|