zhuohan-7 commited on
Commit
565f995
1 Parent(s): cfba64f

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. app/__init__.py +0 -0
  2. app/draw_diagram.py +157 -0
  3. app/pages.py +160 -0
app/__init__.py ADDED
File without changes
app/draw_diagram.py ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+ from streamlit_echarts import st_echarts
5
+ # from streamlit_echarts import JsCode
6
+ from streamlit_javascript import st_javascript
7
+ # from PIL import Image
8
+
9
+ links_dic = {"random": "https://seaeval.github.io/",
10
+ "meta_llama_3_8b": "https://huggingface.co/meta-llama/Meta-Llama-3-8B",
11
+ "mistral_7b_instruct_v0_2": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2",
12
+ "sailor_0_5b": "https://huggingface.co/sail/Sailor-0.5B",
13
+ "sailor_1_8b": "https://huggingface.co/sail/Sailor-1.8B",
14
+ "sailor_4b": "https://huggingface.co/sail/Sailor-4B",
15
+ "sailor_7b": "https://huggingface.co/sail/Sailor-7B",
16
+ "sailor_0_5b_chat": "https://huggingface.co/sail/Sailor-0.5B-Chat",
17
+ "sailor_1_8b_chat": "https://huggingface.co/sail/Sailor-1.8B-Chat",
18
+ "sailor_4b_chat": "https://huggingface.co/sail/Sailor-4B-Chat",
19
+ "sailor_7b_chat": "https://huggingface.co/sail/Sailor-7B-Chat",
20
+ "sea_mistral_highest_acc_inst_7b": "https://seaeval.github.io/",
21
+ "meta_llama_3_8b_instruct": "https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct",
22
+ "flan_t5_base": "https://huggingface.co/google/flan-t5-base",
23
+ "flan_t5_large": "https://huggingface.co/google/flan-t5-large",
24
+ "flan_t5_xl": "https://huggingface.co/google/flan-t5-xl",
25
+ "flan_t5_xxl": "https://huggingface.co/google/flan-t5-xxl",
26
+ "flan_ul2": "https://huggingface.co/google/flan-t5-ul2",
27
+ "flan_t5_small": "https://huggingface.co/google/flan-t5-small",
28
+ "mt0_xxl": "https://huggingface.co/bigscience/mt0-xxl",
29
+ "seallm_7b_v2": "https://huggingface.co/SeaLLMs/SeaLLM-7B-v2",
30
+ "gpt_35_turbo_1106": "https://openai.com/blog/chatgpt",
31
+ "meta_llama_3_70b": "https://huggingface.co/meta-llama/Meta-Llama-3-70B",
32
+ "meta_llama_3_70b_instruct": "https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct",
33
+ "sea_lion_3b": "https://huggingface.co/aisingapore/sea-lion-3b",
34
+ "sea_lion_7b": "https://huggingface.co/aisingapore/sea-lion-7b",
35
+ "qwen1_5_110b": "https://huggingface.co/Qwen/Qwen1.5-110B",
36
+ "qwen1_5_110b_chat": "https://huggingface.co/Qwen/Qwen1.5-110B-Chat",
37
+ "llama_2_7b_chat": "https://huggingface.co/meta-llama/Llama-2-7b-chat-hf",
38
+ "gpt4_1106_preview": "https://openai.com/blog/chatgpt",
39
+ "gemma_2b": "https://huggingface.co/google/gemma-2b",
40
+ "gemma_7b": "https://huggingface.co/google/gemma-7b",
41
+ "gemma_2b_it": "https://huggingface.co/google/gemma-2b-it",
42
+ "gemma_7b_it": "https://huggingface.co/google/gemma-7b-it",
43
+ "qwen_1_5_7b": "https://huggingface.co/Qwen/Qwen1.5-7B",
44
+ "qwen_1_5_7b_chat": "https://huggingface.co/Qwen/Qwen1.5-7B-Chat",
45
+ "sea_lion_7b_instruct": "https://huggingface.co/aisingapore/sea-lion-7b-instruct",
46
+ "sea_lion_7b_instruct_research": "https://huggingface.co/aisingapore/sea-lion-7b-instruct-research",
47
+ "LLaMA_3_Merlion_8B": "https://seaeval.github.io/",
48
+ "LLaMA_3_Merlion_8B_v1_1": "https://seaeval.github.io/"}
49
+
50
+ links_dic = {k.lower().replace('_', '-') : v for k, v in links_dic.items()}
51
+
52
+ # huggingface_image = Image.open('style/huggingface.jpg')
53
+
54
+ def nav_to(value):
55
+ try:
56
+ url = links_dic[str(value).lower()]
57
+ js = f'window.open("{url}", "_blank").then(r => window.parent.location.href);'
58
+ st_javascript(js)
59
+ except:
60
+ pass
61
+
62
+ def draw(folder_name,category_name, dataset_name, sorted):
63
+
64
+ folder = f"./results/{folder_name}/"
65
+
66
+ display_names = {
67
+ 'ASR': 'Automatic Speech Recognition',
68
+ 'SQA': 'Speech Question Answering',
69
+ 'SI': 'Speech Instruction',
70
+ 'AC': 'Audio Captioning',
71
+ 'ASQA': 'Audio Scene Question Answering',
72
+ 'AR': 'Accent Recognition',
73
+ 'GR': 'Gender Recognition',
74
+ 'ER': 'Emotion Recognition'
75
+ }
76
+
77
+ data_path = f'{folder}/{category_name.lower()}.csv'
78
+ chart_data = pd.read_csv(data_path).round(2).dropna(axis=0)
79
+
80
+ if len(chart_data) == 0:
81
+ return
82
+
83
+
84
+ if sorted == 'Ascending':
85
+ ascend = True
86
+ else:
87
+ ascend = False
88
+
89
+ sort_by = dataset_name.replace('-', '_').lower()
90
+
91
+ chart_data = chart_data.sort_values(by=[sort_by], ascending=ascend)
92
+
93
+ min_value = round(chart_data.iloc[:, 1::].min().min() - 0.1, 1)
94
+ max_value = round(chart_data.iloc[:, 1::].max().max() + 0.1, 1)
95
+
96
+ columns = list(chart_data.columns)[1:]
97
+ series = []
98
+ for col in columns:
99
+ series.append(
100
+ {
101
+ "name": f"{col.replace('_', '-')}",
102
+ "type": "line",
103
+ "data": chart_data[f'{col}'].tolist(),
104
+ }
105
+ )
106
+
107
+
108
+ options = {
109
+ "title": {"text": f"{display_names[category_name]}"},
110
+ "tooltip": {
111
+ "trigger": "axis",
112
+ "axisPointer": {"type": "cross", "label": {"backgroundColor": "#6a7985"}},
113
+ "triggerOn": 'mousemove',
114
+ },
115
+ "legend": {"data": ['Overall Accuracy']},
116
+ "toolbox": {"feature": {"saveAsImage": {}}},
117
+ "grid": {"left": "3%", "right": "4%", "bottom": "3%", "containLabel": True},
118
+ "xAxis": [
119
+ {
120
+ "type": "category",
121
+ "boundaryGap": False,
122
+ "triggerEvent": True,
123
+ "data": chart_data['Model'].tolist(),
124
+ }
125
+ ],
126
+ "yAxis": [{"type": "value",
127
+ "min": min_value,
128
+ "max": max_value,
129
+ # "splitNumber": 10
130
+ }],
131
+ "series": series,
132
+ }
133
+
134
+ events = {
135
+ "click": "function(params) { return params.value }"
136
+ }
137
+
138
+ value = st_echarts(options=options, events=events, height="500px")
139
+
140
+ if value != None:
141
+ # print(value)
142
+ nav_to(value)
143
+
144
+ # if value != None:
145
+ # highlight_table_line(value)
146
+
147
+ ### create table
148
+ st.divider()
149
+ # chart_data['Link'] = chart_data['Model'].map(links_dic)
150
+ st.dataframe(chart_data,
151
+ # column_config = {
152
+ # "Link": st.column_config.LinkColumn(
153
+ # display_text= st.image(huggingface_image)
154
+ # ),
155
+ # },
156
+ hide_index = True,
157
+ use_container_width=True)
app/pages.py ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from app.draw_diagram import *
3
+
4
+ def dashboard():
5
+
6
+ with st.container():
7
+ st.title("AudioBench")
8
+
9
+ st.markdown("""
10
+ [gh]: https://github.com/AudioLLMs/AudioBench
11
+ [![GitHub watchers](https://img.shields.io/github/watchers/AudioLLMs/AudioBench?style=social)][gh]
12
+ [![GitHub Repo stars](https://img.shields.io/github/stars/AudioLLMs/AudioBench?style=social)][gh]
13
+ """)
14
+
15
+ audio_url = "https://arxiv.org/abs/2406.16020"
16
+
17
+ st.divider()
18
+ st.markdown("#### [AudioBench](%s)" % audio_url)
19
+ st.markdown("##### :dizzy: A comprehensive evaluation benchmark designed for general instruction-following audiolanguage models")
20
+ st.markdown('''
21
+
22
+
23
+ ''')
24
+
25
+ with st.container():
26
+ left_co, center_co, right_co = st.columns([0.5,1, 0.5])
27
+ with center_co:
28
+ st.image("./style/audio_overview.png",
29
+ caption="Overview of the datasets in AudioBench.",
30
+ use_column_width = True)
31
+
32
+ st.markdown('''
33
+
34
+
35
+ ''')
36
+
37
+ st.markdown("###### :dart: Our Benchmark includes: ")
38
+ cols = st.columns(10)
39
+ cols[1].metric(label="Tasks", value="8", delta="Tasks", delta_color="off")
40
+ cols[2].metric(label="Datasets", value="26", delta="Datasets", delta_color="off")
41
+ cols[3].metric(label="Test On", value="4", delta="Models", delta_color="off")
42
+
43
+ # st.markdown("###### :dart: Supported Models and Datasets: ")
44
+
45
+ # sup = pd.DataFrame(
46
+ # {"Dataset": "LibriSpeech-Clean",
47
+ # "Category": st.selectbox('category', ['Speech Understanding']),
48
+ # "Task": st.selectbox('task', ['Automatic Speech Recognition']),
49
+ # "Metrics": st.selectbox('metrics', ['WER']),
50
+ # "Status":True}
51
+ # )
52
+
53
+ # st.data_editor(sup, num_rows="dynamic")
54
+
55
+
56
+
57
+ st.divider()
58
+ with st.container():
59
+ st.markdown("##### Citations")
60
+
61
+ st.markdown('''
62
+ :round_pushpin: AudioBench Paper \n
63
+ @article{wang2024audiobench,
64
+ title={AudioBench: A Universal Benchmark for Audio Large Language Models},
65
+ author={Wang, Bin and Zou, Xunlong and Lin, Geyu and Sun, Shuo and Liu, Zhuohan and Zhang, Wenyu and Liu, Zhengyuan and Aw, AiTi and Chen, Nancy F},
66
+ journal={arXiv preprint arXiv:2406.16020},
67
+ year={2024}
68
+ }
69
+ ''')
70
+
71
+ def speech_understanding():
72
+ st.title("Speech Understanding")
73
+
74
+ filters_levelone = ['ASR', 'SQA', 'SI']
75
+ sort_leveltwo = []
76
+
77
+ left, center, _, middle,right = st.columns([0.2, 0.2, 0.2, 0.2 ,0.2])
78
+
79
+ with left:
80
+ filter_1 = st.selectbox('Select Category', filters_levelone)
81
+
82
+ with middle:
83
+ if filter_1 == filters_levelone[0]:
84
+ sort_leveltwo = ['LibriSpeech-Test-Clean', 'LibriSpeech-Test-Other', 'Common-Voice-15-En-Test', 'Peoples-Speech-Test',
85
+ 'GigaSpeech-Test', 'Tedlium3-Test','Tedlium3-Longform-Test', 'Earning-21-Test', 'Earning-22-Test']
86
+ elif filter_1 == filters_levelone[1]:
87
+ sort_leveltwo = ['CN-College-Listen-Test', 'SLUE-P2-SQA5-Test', 'DREAM-TTS-Test', 'Public-SG-SpeechQA-Test']
88
+
89
+ elif filter_1 == filters_levelone[2]:
90
+ sort_leveltwo = ['OpenHermes-Audio-Test', 'ALPACA-Audio-Test']
91
+
92
+ sort = st.selectbox("Sort Dataset", sort_leveltwo)
93
+
94
+ with right:
95
+ sorted = st.selectbox('by', ['Ascending', 'Descending'])
96
+
97
+ if filter_1 or sort or sorted:
98
+ draw('su',filter_1, sort, sorted)
99
+ else:
100
+ draw('su', 'ASR', 'LibriSpeech-Test-Clean', 'Descending')
101
+
102
+
103
+ def audio_scene_understanding():
104
+ st.title("Audio Scence Understanding")
105
+
106
+ filters_levelone = ['AQA', 'AC']
107
+ sort_leveltwo = []
108
+
109
+ left, center, _, middle,right = st.columns([0.2, 0.2, 0.2, 0.2 ,0.2])
110
+
111
+ with left:
112
+ filter_1 = st.selectbox('Select Category', filters_levelone)
113
+
114
+ with middle:
115
+ if filter_1 == filters_levelone[0]:
116
+ sort_leveltwo = ['Clotho-AQA-Test', 'WavCaps-QA-Test', 'AudioCaps-QA-Test']
117
+ elif filter_1 == filters_levelone[1]:
118
+ sort_leveltwo = ['WavCaps-Test', 'AudioCaps-Test']
119
+
120
+ sort = st.selectbox("Sort Dataset", sort_leveltwo)
121
+
122
+ with right:
123
+ sorted = st.selectbox('by', ['Ascending', 'Descending'])
124
+
125
+ if filter_1 or sort or sorted:
126
+ draw('asu',filter_1, sort, sorted)
127
+ else:
128
+ draw('asu', 'AQA', 'Clotho-AQA-Test', 'Descending')
129
+
130
+
131
+ def voice_understanding():
132
+ st.title("Voice Understanding")
133
+
134
+ filters_levelone = ['ER', 'AR', 'GR']
135
+ sort_leveltwo = []
136
+
137
+ left, center, _, middle,right = st.columns([0.2, 0.2, 0.2, 0.2 ,0.2])
138
+
139
+ with left:
140
+ filter_1 = st.selectbox('Select Category', filters_levelone)
141
+
142
+ with middle:
143
+ if filter_1 == filters_levelone[0]:
144
+ sort_leveltwo = ['IEMOCAP-Emotion-Test', 'MELD-Sentiment-Test', 'MELD-Emotion-Test']
145
+
146
+ elif filter_1 == filters_levelone[1]:
147
+ sort_leveltwo = ['VoxCeleb1-Accent-Test']
148
+
149
+ elif filter_1 == filters_levelone[2]:
150
+ sort_leveltwo = ['VoxCeleb1-Gender-Test', 'IEMOCAP-Gender-Test']
151
+
152
+ sort = st.selectbox("Sort Dataset", sort_leveltwo)
153
+
154
+ with right:
155
+ sorted = st.selectbox('by', ['Ascending', 'Descending'])
156
+
157
+ if filter_1 or sort or sorted:
158
+ draw('vu',filter_1, sort, sorted)
159
+ else:
160
+ draw('vu', 'ER', 'IEMOCAP-Emotion-Test', 'Descending')