Spaces:
Running
Running
File size: 1,448 Bytes
bc87bb9 064d8d7 bc87bb9 f710cf8 bc87bb9 4e0c371 bc87bb9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import gradio as gr
from df.author_leaderboard import AuthorLeaderboard
def author_leaderboard_tab():
# Initialize the AuthorLeaderboard class
leaderboard = AuthorLeaderboard()
with gr.Row():
gr.Markdown(
"""
## Authors Leaderboard
The leaderboard focuses on <b>paper authors</b> whose works have attracted artifacts (models, datasets, spaces) from the community, even if they did not create these artifacts themselves. It ranks authors based on the total number of artifacts associated with their papers, along with other metrics like the number of papers they have, upvotes, comments, and average artifacts per paper.
""")
with gr.Row():
author_search_input = gr.Textbox(
label="Search by Author Name",
placeholder="Enter author name...",
lines=1,
)
with gr.Row():
leaderboard_component = gr.Dataframe(
label="Leaderboard",
value=leaderboard.df_prettified,
datatype=[leaderboard.DATATYPES[column] for column in leaderboard.COLUMNS_ORDER],
row_count=(0, "dynamic"),
interactive=False,
max_height=1000,
wrap=True,
)
# Define the interaction
author_search_input.change(
leaderboard.filter,
inputs=[author_search_input],
outputs=[leaderboard_component],
api_name=False,
)
|