Spaces:
Sleeping
Sleeping
vtrv.vls
commited on
Commit
Β·
c03435f
1
Parent(s):
e7d646f
table test
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import argparse
|
|
3 |
import os
|
4 |
import boto3
|
5 |
from datetime import datetime
|
|
|
6 |
|
7 |
from utils import generate, send_to_s3
|
8 |
from models import get_tiny_llama, response_tiny_llama
|
@@ -32,6 +33,27 @@ def tab_arena():
|
|
32 |
|
33 |
# arena.launch()
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
with open("test.md", "r") as f:
|
36 |
TEST_MD = f.read()
|
37 |
|
@@ -47,7 +69,7 @@ def build_demo():
|
|
47 |
with gradio.Tabs(elem_classes="tab-buttons") as tabs:
|
48 |
with gradio.TabItem("πΌ MERA leaderboard", elem_id="od-benchmark-tab-table", id=0):
|
49 |
gradio.Markdown(TEST_MD, elem_classes="markdown-text-details")
|
50 |
-
|
51 |
|
52 |
with gradio.TabItem("π SBS by categories and criteria", elem_id="od-benchmark-tab-table", id=1):
|
53 |
gradio.Markdown(TEST_MD, elem_classes="markdown-text-details")
|
|
|
3 |
import os
|
4 |
import boto3
|
5 |
from datetime import datetime
|
6 |
+
import pandas as pd
|
7 |
|
8 |
from utils import generate, send_to_s3
|
9 |
from models import get_tiny_llama, response_tiny_llama
|
|
|
33 |
|
34 |
# arena.launch()
|
35 |
|
36 |
+
def tab_leaderboard():
|
37 |
+
df = pd.DataFrame({
|
38 |
+
"Model" : ['A', 'B', 'C',],
|
39 |
+
"Test 1" : [0, 1, 0],
|
40 |
+
"Test 2" : [1, 0, 1,],
|
41 |
+
})
|
42 |
+
|
43 |
+
# Function to apply text color
|
44 |
+
def highlight_cols(x):
|
45 |
+
df = x.copy()
|
46 |
+
# df.loc[:, :] = 'color: purple'
|
47 |
+
df[['Model']] = 'color: green'
|
48 |
+
return df
|
49 |
+
|
50 |
+
# Applying the style function
|
51 |
+
# s = df.style.apply(highlight_cols, axis = None)
|
52 |
+
|
53 |
+
# Displaying the styled dataframe in Gradio
|
54 |
+
with gradio.Blocks() as demo:
|
55 |
+
gradio.DataFrame(df)
|
56 |
+
|
57 |
with open("test.md", "r") as f:
|
58 |
TEST_MD = f.read()
|
59 |
|
|
|
69 |
with gradio.Tabs(elem_classes="tab-buttons") as tabs:
|
70 |
with gradio.TabItem("πΌ MERA leaderboard", elem_id="od-benchmark-tab-table", id=0):
|
71 |
gradio.Markdown(TEST_MD, elem_classes="markdown-text-details")
|
72 |
+
tab_leaderboard()
|
73 |
|
74 |
with gradio.TabItem("π SBS by categories and criteria", elem_id="od-benchmark-tab-table", id=1):
|
75 |
gradio.Markdown(TEST_MD, elem_classes="markdown-text-details")
|