hieunguyen1053 commited on
Commit
0e7f11a
·
1 Parent(s): 9c658aa

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -0
app.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ import gradio as gr
4
+ from huggingface_hub import HfFileSystem
5
+
6
+ from src.assets.text_content import INTRODUCTION_TEXT, TITLE
7
+
8
+ from src.load_from_hub import load_from_hub
9
+
10
+ RESULTS_REPO = os.environ.get("RESULTS_REPO", "datasets/vlsp-2023-vllm/vllms-leaderboard")
11
+ HIDDEN_TOKEN = os.environ.get("HIDDEN_TOKEN")
12
+
13
+ fs = HfFileSystem(token=HIDDEN_TOKEN)
14
+
15
+ leaderboard_df = load_from_hub(fs, RESULTS_REPO)
16
+
17
+ demo = gr.Blocks()
18
+
19
+ with demo:
20
+ gr.HTML(TITLE)
21
+ gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
22
+
23
+ with gr.Tabs(elem_classes="tab-buttons") as tabs:
24
+ with gr.TabItem("VLLMs Benchmark", elem_id="llm-benchmark-tab-table", id=0):
25
+ with gr.Column():
26
+ with gr.Row():
27
+ search_bar = gr.Textbox(
28
+ placeholder=" 🔍 Search for your model and press ENTER...",
29
+ show_label=False,
30
+ elem_id="search-bar",
31
+ )
32
+ with gr.Row():
33
+ leaderboard_table = gr.components.Dataframe(
34
+ value=leaderboard_df,
35
+ )
36
+
37
+ demo.launch()