Spaces:
Runtime error
Runtime error
File size: 2,611 Bytes
234bc89 e720075 b558422 234bc89 d48c54e e720075 234bc89 d4742e4 234bc89 07c333a 234bc89 07c333a 234bc89 b558422 234bc89 b558422 4cbe63b 07c333a b558422 234bc89 a545a20 234bc89 9bd8edd 234bc89 969c59e 234bc89 969c59e 234bc89 969c59e 234bc89 969c59e 234bc89 0cc1261 d4742e4 |
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
import gradio as gr
from apscheduler.schedulers.background import BackgroundScheduler
from src.about import (
CITATION_BUTTON_LABEL,
CITATION_BUTTON_TEXT,
INTRODUCTION_TEXT,
LLM_BENCHMARKS_TEXT,
TITLE,
)
from src.display.css_html_js import custom_css
from src.envs import API, REPO_ID, TOKEN
from src import populate
def restart_space():
print(TOKEN)
API.restart_space(repo_id=REPO_ID, token=TOKEN)
# restart_space()
demo = gr.Blocks(css=custom_css)
with demo:
gr.HTML(TITLE)
# with gr.Column(scale=5):
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
# with gr.Column(scale=2):
# gr.Markdown("""
# ![](src/logo.png)
# """)
with gr.Tabs(elem_classes="tab-buttons") as tabs:
with gr.TabItem("π
LLM Benchmark", elem_id="llm-benchmark-tab-table", id=0):
leaderboard_df = populate.load_leaderboard()
leaderboard_table = gr.components.Dataframe(
value=leaderboard_df,
# headers=dummy_leaderboard.HEADERS,
headers=["", "Model", "Accuracy", "Agreement", "Self-Accuracy", "Self-Agreement"],
datatype=populate.TYPES,
elem_id="leaderboard-table",
interactive=False,
visible=True,
height=800,
)
with gr.TabItem("π About", elem_id="llm-benchmark-tab-table", id=2):
# with gr.Column(scale=2):
# gr.Markdown("""
# ![](src/logo.png)
# """)
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
with gr.Row():
with gr.Accordion("π Citation", open=False):
citation_button = gr.Textbox(
value=CITATION_BUTTON_TEXT,
label=CITATION_BUTTON_LABEL,
lines=6,
elem_id="citation-button",
show_copy_button=True,
)
# with gr.TabItem("π Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
# with gr.Column():
# with gr.Row():
# gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
# with gr.Row():
# gr.Markdown("# βοΈβ¨ Submit your model here!", elem_classes="markdown-text")
# scheduler = BackgroundScheduler()
# scheduler.add_job(restart_space, "interval", seconds=300)
# scheduler.start()
# demo.queue().launch()
demo.launch()
|