import os import gradio as gr from huggingface_hub import HfFileSystem from src.assets.text_content import INTRODUCTION_TEXT, TITLE from src.load_from_hub import load_from_hub RESULTS_REPO = os.environ.get("RESULTS_REPO", "datasets/vlsp-2023-vllm/vllms-leaderboard") HIDDEN_TOKEN = os.environ.get("HIDDEN_TOKEN") fs = HfFileSystem(token=HIDDEN_TOKEN) leaderboard_df = load_from_hub(fs, RESULTS_REPO) demo = gr.Blocks() with demo: gr.HTML(TITLE) gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text") with gr.Tabs(elem_classes="tab-buttons") as tabs: with gr.TabItem("VLLMs Benchmark", elem_id="llm-benchmark-tab-table", id=0): with gr.Column(): with gr.Row(): search_bar = gr.Textbox( placeholder=" 🔍 Search for your model and press ENTER...", show_label=False, elem_id="search-bar", ) with gr.Row(): leaderboard_table = gr.components.Dataframe( value=leaderboard_df, ) demo.launch()