carbonnnnn commited on
Commit
fbdc657
·
1 Parent(s): 68e6513

all working blocks

Browse files
app.py CHANGED
@@ -2,8 +2,9 @@ import pandas as pd
2
  import gradio as gr
3
  import os
4
  from gradio_rangeslider import RangeSlider
 
5
 
6
- from utils.filter_utils import filter
7
 
8
  # MAPS = filter_utils.LANG_MAPPING
9
 
@@ -12,45 +13,56 @@ text_leaderboard = pd.read_csv(os.path.join('src', 'main_df.csv'))
12
  text = "## The range is: {min} to {max}"
13
 
14
  # Short leaderboard containing fixed columns
15
- short_leaderboard = text_leaderboard[[
16
- 'model_name',
17
- 'input_price',
18
- 'output_price',
19
- 'release_date',
20
- 'context_size',
21
- 'average_clemscore',
22
- 'average_latency',
23
- 'parameter_size',
24
- ]]
25
-
26
- ## Get Languages
27
  langs = []
 
 
 
 
 
 
 
 
28
  for i in range(len(text_leaderboard)):
29
- lang_splits = text_leaderboard.iloc[i]['languages'].split(',')
30
  lang_splits = [s.strip() for s in lang_splits]
31
  langs += lang_splits
 
 
 
 
 
 
 
 
 
 
 
32
  langs = list(set(langs))
33
  langs.sort()
34
 
35
- ## Get input prices
36
- ip_prices = []
37
- op_prices = []
38
- for i in range(len(text_leaderboard)):
39
- ip_prices.append(text_leaderboard.iloc[i]['input_price'])
40
- op_prices.append(text_leaderboard.iloc[i]['output_price'])
41
 
42
  max_input_price = max(ip_prices)
43
  max_output_price = max(op_prices)
 
44
 
 
 
45
 
46
- llm_calc_app = gr.Blocks()
47
- with llm_calc_app:
48
 
49
- with gr.Row():
50
- """
51
- Main Filters Row
52
- """
53
-
 
54
  ### Language filter
55
  with gr.Row():
56
  lang_dropdown = gr.Dropdown(
@@ -60,13 +72,46 @@ with llm_calc_app:
60
  label="Select Languages 🕹️"
61
  )
62
 
63
- clemscore_slider = RangeSlider(
64
- minimum=0,
65
- maximum=100,
66
- value=(0, 100),
67
- label="Select Clemscore range"
68
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
 
70
  input_pricing_slider = RangeSlider(
71
  minimum=0,
72
  maximum=max_input_price,
@@ -81,6 +126,28 @@ with llm_calc_app:
81
  label="Select Price range /1M output tokens"
82
  )
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
 
86
  with gr.Row():
@@ -93,7 +160,8 @@ with llm_calc_app:
93
  elem_id="text-leaderboard-table",
94
  interactive=False,
95
  visible=True,
96
- height=800
 
97
  )
98
 
99
 
@@ -106,32 +174,90 @@ with llm_calc_app:
106
 
107
  lang_dropdown.change(
108
  filter,
109
- [dummy_leaderboard_table, lang_dropdown, clemscore_slider,
110
- input_pricing_slider, output_pricing_slider],
 
111
  [leaderboard_table],
112
  queue=True
113
  )
114
 
115
- clemscore_slider.change(
116
  filter,
117
- [dummy_leaderboard_table, lang_dropdown, clemscore_slider,
118
- input_pricing_slider, output_pricing_slider],
 
119
  [leaderboard_table],
120
  queue=True
121
  )
122
 
123
  input_pricing_slider.change(
124
  filter,
125
- [dummy_leaderboard_table, lang_dropdown, clemscore_slider,
126
- input_pricing_slider, output_pricing_slider],
 
127
  [leaderboard_table],
128
  queue=True
129
  )
130
 
131
  output_pricing_slider.change(
132
  filter,
133
- [dummy_leaderboard_table, lang_dropdown, clemscore_slider,
134
- input_pricing_slider, output_pricing_slider],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  [leaderboard_table],
136
  queue=True
137
  )
 
2
  import gradio as gr
3
  import os
4
  from gradio_rangeslider import RangeSlider
5
+ import math
6
 
7
+ from utils.filter_utils import filter, filter_cols
8
 
9
  # MAPS = filter_utils.LANG_MAPPING
10
 
 
13
  text = "## The range is: {min} to {max}"
14
 
15
  # Short leaderboard containing fixed columns
16
+ short_leaderboard = filter_cols(text_leaderboard)
17
+
18
+
19
+ ## Extract data
 
 
 
 
 
 
 
 
20
  langs = []
21
+ licenses = []
22
+ ip_prices = []
23
+ op_prices = []
24
+ latencies = []
25
+ parameters = []
26
+ contexts = []
27
+ dates = []
28
+
29
  for i in range(len(text_leaderboard)):
30
+ lang_splits = text_leaderboard.iloc[i]['Languages'].split(',')
31
  lang_splits = [s.strip() for s in lang_splits]
32
  langs += lang_splits
33
+ license_name = text_leaderboard.iloc[i]['License Name']
34
+
35
+ licenses.append(license_name)
36
+ ip_prices.append(text_leaderboard.iloc[i]['Input $/1M'])
37
+ op_prices.append(text_leaderboard.iloc[i]['Output $/1M'])
38
+ latencies.append(text_leaderboard.iloc[i]['Average Latency (s)'])
39
+ parameters.append(text_leaderboard.iloc[i]['Parameter Size (B)'])
40
+ contexts.append(text_leaderboard.iloc[i]['Context Size'])
41
+ dates.append(text_leaderboard.iloc[i]['Release Date'])
42
+
43
+
44
  langs = list(set(langs))
45
  langs.sort()
46
 
47
+ licenses = list(set(licenses))
48
+ licenses.sort()
 
 
 
 
49
 
50
  max_input_price = max(ip_prices)
51
  max_output_price = max(op_prices)
52
+ max_latency = max(latencies)
53
 
54
+ max_parameter = max(parameters)
55
+ max_parameter = math.ceil(math.log2(max_parameter))
56
 
57
+ max_context = max(contexts)/1024
58
+ max_context = math.ceil(math.log2(max_context))
59
 
60
+ min_date = min(dates)
61
+ max_date = max(dates)
62
+
63
+
64
+ llm_calc_app = gr.Blocks()
65
+ with llm_calc_app:
66
  ### Language filter
67
  with gr.Row():
68
  lang_dropdown = gr.Dropdown(
 
72
  label="Select Languages 🕹️"
73
  )
74
 
75
+ with gr.Row():
76
+ with gr.Column(scale=3):
77
+ parameter_slider = RangeSlider(
78
+ minimum=0,
79
+ maximum=max_parameter,
80
+ label="Select Parameters. Range -> 2^x - 2^y"
81
+ )
82
+ with gr.Column(scale=1):
83
+ range_ = gr.Markdown(value=text.format(min=0, max=math.pow(2, max_parameter)))
84
+ parameter_slider.change(lambda s: text.format(min=int(pow(2,s[0])), max=int(pow(2,s[1]))), parameter_slider, range_,
85
+ show_progress="hide", trigger_mode="always_last")
86
+
87
+ with gr.Row():
88
+ with gr.Column(scale=3):
89
+ context_slider = RangeSlider(
90
+ minimum=0,
91
+ maximum=max_context,
92
+ label="Select Context length range. Range -> 2^x k - 2^y k"
93
+ )
94
+ with gr.Column(scale=1):
95
+ context_range_ = gr.Markdown(value=text.format(min=0, max=math.pow(2, max_context)))
96
+ context_slider.change(lambda s: text.format(min=int(pow(2,s[0])), max=int(pow(2,s[1]))), context_slider, context_range_,
97
+ show_progress="hide", trigger_mode="always_last")
98
+
99
+ with gr.Row():
100
+ with gr.Column():
101
+ start_date = gr.DateTime(
102
+ value=min_date,
103
+ type="string",
104
+ label="Select start date"
105
+ )
106
+
107
+ with gr.Column():
108
+ end_date = gr.DateTime(
109
+ value=max_date,
110
+ type="string",
111
+ label="Select end date"
112
+ )
113
 
114
+ with gr.Row():
115
  input_pricing_slider = RangeSlider(
116
  minimum=0,
117
  maximum=max_input_price,
 
126
  label="Select Price range /1M output tokens"
127
  )
128
 
129
+ with gr.Row():
130
+ with gr.Column():
131
+ multimodal_checkbox = gr.CheckboxGroup(
132
+ choices=['Image', 'Multi-Image', 'Audio', 'Video'],
133
+ value=[],
134
+ label="Select additional Modalities",
135
+ )
136
+
137
+ with gr.Column():
138
+ open_weight_checkbox = gr.CheckboxGroup(
139
+ choices=['Open', 'Commercial'],
140
+ value=['Open', 'Commercial'],
141
+ label="Filter Open-weight model or commercial model",
142
+ )
143
+
144
+ with gr.Column():
145
+ license_checkbox = gr.CheckboxGroup(
146
+ choices=licenses,
147
+ value=licenses,
148
+ label="Filter based on the type of License",
149
+ )
150
+
151
 
152
 
153
  with gr.Row():
 
160
  elem_id="text-leaderboard-table",
161
  interactive=False,
162
  visible=True,
163
+ height=800,
164
+ datatype=['html', 'number', 'number', 'date', 'number', 'number', 'number', 'number', 'html']
165
  )
166
 
167
 
 
174
 
175
  lang_dropdown.change(
176
  filter,
177
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
178
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
179
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
180
  [leaderboard_table],
181
  queue=True
182
  )
183
 
184
+ parameter_slider.change(
185
  filter,
186
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
187
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
188
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
189
  [leaderboard_table],
190
  queue=True
191
  )
192
 
193
  input_pricing_slider.change(
194
  filter,
195
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
196
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
197
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
198
  [leaderboard_table],
199
  queue=True
200
  )
201
 
202
  output_pricing_slider.change(
203
  filter,
204
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
205
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
206
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
207
+ [leaderboard_table],
208
+ queue=True
209
+ )
210
+
211
+ multimodal_checkbox.change(
212
+ filter,
213
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
214
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
215
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
216
+ [leaderboard_table],
217
+ queue=True
218
+ )
219
+
220
+ open_weight_checkbox.change(
221
+ filter,
222
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
223
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
224
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
225
+ [leaderboard_table],
226
+ queue=True
227
+ )
228
+
229
+ context_slider.change(
230
+ filter,
231
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
232
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
233
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
234
+ [leaderboard_table],
235
+ queue=True
236
+ )
237
+
238
+ start_date.change(
239
+ filter,
240
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
241
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
242
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
243
+ [leaderboard_table],
244
+ queue=True
245
+ )
246
+
247
+ end_date.change(
248
+ filter,
249
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
250
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
251
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
252
+ [leaderboard_table],
253
+ queue=True
254
+ )
255
+
256
+ license_checkbox.change(
257
+ filter,
258
+ [dummy_leaderboard_table, lang_dropdown, parameter_slider,
259
+ input_pricing_slider, output_pricing_slider, multimodal_checkbox,
260
+ context_slider, open_weight_checkbox, start_date, end_date, license_checkbox],
261
  [leaderboard_table],
262
  queue=True
263
  )
src/main_df.csv CHANGED
@@ -1,24 +1,24 @@
1
- model_name,input_price,output_price,multimodality_image,multimodality_multiple_image,multimodality_audio,multimodality_video,source,license_name,license_url,languages,release_date,open_weight,context_size,average_clemscore,average_latency,parameter_size,estimated
2
- Meta-Llama-3-70B-Instruct-hf,0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct,Meta Llama 3 License,https://www.llama.com/llama3/license/,English,2024-04-18,True,8192,11.703333333333333,1.1160853862207483,70.0,False
3
- Meta-Llama-3-8B-Instruct-hf,0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct,Meta Llama 3 License,https://www.llama.com/llama3/license/,English,2024-04-18,True,8192,6.663333333333333,0.7054825144189354,8.0,False
4
- Meta-Llama-3.1-405B-Instruct-Turbo,0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct,Llama 3.1 Community License,https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE,"English, German, French, Italian, Hindi, Portuguese, Spanish, Thai",2024-07-23,True,131072,17.37,0.2628701315515277,405.0,False
5
- Meta-Llama-3.1-70B-Instruct,0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct,Llama 3.1 Community License,https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE,"English, German, French, Italian, Hindi, Portuguese, Spanish, Thai",2024-07-23,True,131072,12.943333333333333,0.27016850919817575,70.0,False
6
- Meta-Llama-3.1-8B-Instruct,0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct,Llama 3.1 Community License,https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE,"English, German, French, Italian, Hindi, Portuguese, Spanish, Thai",2024-07-23,True,131072,6.12,0.06876858280202812,8.0,False
7
- InternVL2-40B,0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-40B,MIT,https://choosealicense.com/licenses/mit/,"Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,21.810000000000002,2.609271782765464,40.0,False
8
- InternVL2-8B,0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-8B,MIT,https://choosealicense.com/licenses/mit/,"Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,19.74,0.8367998047485775,8.0,False
9
- InternVL2-Llama3-76B,0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-Llama3-76B,MIT,https://choosealicense.com/licenses/mit/,"Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,25.709999999999997,4.591395944741546,76.0,False
10
- InternVL2-26B,0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-26B,MIT,https://choosealicense.com/licenses/mit/,"Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,23.24,1.7593004986949285,26.0,False
11
- InternVL2-26B,0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-26B,MIT,https://choosealicense.com/licenses/mit/,"Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,23.24,1.7593004986949285,26.0,False
12
- Mistral-Large-Instruct-2407,0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mistral-Large-Instruct-2407,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,"English, French, Spanish, German, Italian, Russian, Chinese, Japanese, Korean",2024-06-12,True,8192,15.13,0.41482225628780656,70.0,False
13
- Mixtral-8x22B-Instruct-v0.1,0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,"English, French, Spanish, German, Italian, Russian",2024-04-17,True,8192,4.2299999999999995,0.3586451521191292,141.0,False
14
- Mistral-7B-Instruct-v0.2,0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,"English, French, Spanish, German, Italian, Russian, Chinese",2024-01-15,True,8192,3.25,0.25450503989030154,7.0,False
15
- Mistral-7B-Instruct-v0.1,0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,"English, French, Spanish, German, Italian, Russian, Chinese",2023-12-11,True,8192,2.67,0.09428825169239076,7.0,False
16
- Mixtral-8x7B-Instruct-v0.1,0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,"English, French, Spanish, German, Italian, Russian",2023-12-11,True,8192,2.723333333333333,0.31309892202121054,46.7,False
17
- openchat-3.5-0106,0.0,0.0,False,False,False,False,https://huggingface.co/openchat/openchat-3.5-0106,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,English,2024-01-06,True,8192,5.7,0.09736504835188847,7.0,False
18
- openchat-3.5-1210,0.0,0.0,False,False,False,False,https://huggingface.co/openchat/openchat-3.5-1210,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,English,2023-12-10,True,8192,6.073333333333333,0.09349942563676568,7.0,False
19
- openchat_3.5,0.0,0.0,False,False,False,False,https://huggingface.co/openchat/openchat_3.5,Apache 2.0,https://www.apache.org/licenses/LICENSE-2.0,English,2023-10-30,True,8192,7.88,0.10576256228206875,7.0,False
20
- gpt-4o-mini-2024-07-18,0.15,0.6,True,True,False,False,https://openai.com/api/pricing/,Commercial License,https://openai.com/policies/terms-of-use,"English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2024-07-18,False,131072,52.32333333333333,1.619222935116773,8.0,True
21
- gpt-4o-2024-08-06,2.5,10.0,True,True,False,False,https://openai.com/api/pricing/,Commercial License,https://openai.com/policies/terms-of-use,"English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2024-08-06,False,131072,69.57000000000001,1.5771123003908176,200.0,True
22
- gpt-4o-2024-05-13,2.5,10.0,True,True,False,False,https://openai.com/api/pricing/,Commercial License,https://openai.com/policies/terms-of-use,"English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2024-05-13,False,131072,66.87333333333333,3.704921340164487,200.0,True
23
- gpt-4-1106-vision-preview,10.0,30.0,True,True,False,False,https://openai.com/api/pricing/,Commercial License,https://openai.com/policies/terms-of-use,"English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2023-11-06,False,131072,47.23,2.217200177676117,1760.0,True
24
- gemini-1.5-flash-latest,0.075,0.3,True,True,True,True,https://cloud.google.com/vertex-ai/generative-ai/pricing,Commercial License,,"Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Thai, Turkish, Ukrainian, Vietnamese, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Arabic, Bengali, Bulgarian",2024-05-24,False,131072,42.53666666666667,26.268280234692302,1760.0,True
 
1
+ Model Name,Input $/1M,Output $/1M,Multimodality Image,Multimodality Multiple Image,Multimodality Audio,Multimodality Video,Source,License Name,License,Languages,Release Date,Open Weight,Context Size,Average Clemscore,Average Latency (s),Parameter Size (B),Estimated
2
+ "<a href=""https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct"" style=""color: blue;"">Meta-Llama-3-70B-Instruct-hf</a>",0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct,Meta Llama 3 License,"<a href=""https://www.llama.com/llama3/license/"" style=""color: blue;"">Meta Llama 3 License</a>",English,2024-04-18,True,8192,11.703,1.116,70.0,False
3
+ "<a href=""https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct"" style=""color: blue;"">Meta-Llama-3-8B-Instruct-hf</a>",0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct,Meta Llama 3 License,"<a href=""https://www.llama.com/llama3/license/"" style=""color: blue;"">Meta Llama 3 License</a>",English,2024-04-18,True,8192,6.663,0.705,8.0,False
4
+ "<a href=""https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct"" style=""color: blue;"">Meta-Llama-3.1-405B-Instruct-Turbo</a>",0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct,Llama 3.1 Community License,"<a href=""https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE"" style=""color: blue;"">Llama 3.1 Community License</a>","English, German, French, Italian, Hindi, Portuguese, Spanish, Thai",2024-07-23,True,131072,17.37,0.263,405.0,False
5
+ "<a href=""https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct"" style=""color: blue;"">Meta-Llama-3.1-70B-Instruct</a>",0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct,Llama 3.1 Community License,"<a href=""https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE"" style=""color: blue;"">Llama 3.1 Community License</a>","English, German, French, Italian, Hindi, Portuguese, Spanish, Thai",2024-07-23,True,131072,12.943,0.27,70.0,False
6
+ "<a href=""https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct"" style=""color: blue;"">Meta-Llama-3.1-8B-Instruct</a>",0.0,0.0,False,False,False,False,https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct,Llama 3.1 Community License,"<a href=""https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE"" style=""color: blue;"">Llama 3.1 Community License</a>","English, German, French, Italian, Hindi, Portuguese, Spanish, Thai",2024-07-23,True,131072,6.12,0.069,8.0,False
7
+ "<a href=""https://huggingface.co/OpenGVLab/InternVL2-40B"" style=""color: blue;"">InternVL2-40B</a>",0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-40B,MIT,"<a href=""https://choosealicense.com/licenses/mit/"" style=""color: blue;"">MIT</a>","Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,21.81,2.609,40.0,False
8
+ "<a href=""https://huggingface.co/OpenGVLab/InternVL2-8B"" style=""color: blue;"">InternVL2-8B</a>",0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-8B,MIT,"<a href=""https://choosealicense.com/licenses/mit/"" style=""color: blue;"">MIT</a>","Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,19.74,0.837,8.0,False
9
+ "<a href=""https://huggingface.co/OpenGVLab/InternVL2-Llama3-76B"" style=""color: blue;"">InternVL2-Llama3-76B</a>",0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-Llama3-76B,MIT,"<a href=""https://choosealicense.com/licenses/mit/"" style=""color: blue;"">MIT</a>","Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,25.71,4.591,76.0,False
10
+ "<a href=""https://huggingface.co/OpenGVLab/InternVL2-26B"" style=""color: blue;"">InternVL2-26B</a>",0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-26B,MIT,"<a href=""https://choosealicense.com/licenses/mit/"" style=""color: blue;"">MIT</a>","Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,23.24,1.759,26.0,False
11
+ "<a href=""https://huggingface.co/OpenGVLab/InternVL2-26B"" style=""color: blue;"">InternVL2-26B</a>",0.0,0.0,True,True,False,False,https://huggingface.co/OpenGVLab/InternVL2-26B,MIT,"<a href=""https://choosealicense.com/licenses/mit/"" style=""color: blue;"">MIT</a>","Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic",2024-07-15,True,8192,23.24,1.759,26.0,False
12
+ "<a href=""https://huggingface.co/mistralai/Mistral-Large-Instruct-2407"" style=""color: blue;"">Mistral-Large-Instruct-2407</a>",0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mistral-Large-Instruct-2407,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>","English, French, Spanish, German, Italian, Russian, Chinese, Japanese, Korean",2024-06-12,True,8192,15.13,0.415,70.0,False
13
+ "<a href=""https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1"" style=""color: blue;"">Mixtral-8x22B-Instruct-v0.1</a>",0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>","English, French, Spanish, German, Italian, Russian",2024-04-17,True,8192,4.23,0.359,141.0,False
14
+ "<a href=""https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2"" style=""color: blue;"">Mistral-7B-Instruct-v0.2</a>",0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>","English, French, Spanish, German, Italian, Russian, Chinese",2024-01-15,True,8192,3.25,0.255,7.0,False
15
+ "<a href=""https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1"" style=""color: blue;"">Mistral-7B-Instruct-v0.1</a>",0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>","English, French, Spanish, German, Italian, Russian, Chinese",2023-12-11,True,8192,2.67,0.094,7.0,False
16
+ "<a href=""https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1"" style=""color: blue;"">Mixtral-8x7B-Instruct-v0.1</a>",0.0,0.0,False,False,False,False,https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>","English, French, Spanish, German, Italian, Russian",2023-12-11,True,8192,2.723,0.313,46.7,False
17
+ "<a href=""https://huggingface.co/openchat/openchat-3.5-0106"" style=""color: blue;"">openchat-3.5-0106</a>",0.0,0.0,False,False,False,False,https://huggingface.co/openchat/openchat-3.5-0106,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>",English,2024-01-06,True,8192,5.7,0.097,7.0,False
18
+ "<a href=""https://huggingface.co/openchat/openchat-3.5-1210"" style=""color: blue;"">openchat-3.5-1210</a>",0.0,0.0,False,False,False,False,https://huggingface.co/openchat/openchat-3.5-1210,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>",English,2023-12-10,True,8192,6.073,0.093,7.0,False
19
+ "<a href=""https://huggingface.co/openchat/openchat_3.5"" style=""color: blue;"">openchat_3.5</a>",0.0,0.0,False,False,False,False,https://huggingface.co/openchat/openchat_3.5,Apache 2.0,"<a href=""https://www.apache.org/licenses/LICENSE-2.0"" style=""color: blue;"">Apache 2.0</a>",English,2023-10-30,True,8192,7.88,0.106,7.0,False
20
+ "<a href=""https://openai.com/api/pricing/"" style=""color: blue;"">gpt-4o-mini-2024-07-18</a>",0.15,0.6,True,True,False,False,https://openai.com/api/pricing/,Commercial License,"<a href=""https://openai.com/policies/terms-of-use"" style=""color: blue;"">Commercial License</a>","English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2024-07-18,False,131072,52.323,1.619,8.0,True
21
+ "<a href=""https://openai.com/api/pricing/"" style=""color: blue;"">gpt-4o-2024-08-06</a>",2.5,10.0,True,True,False,False,https://openai.com/api/pricing/,Commercial License,"<a href=""https://openai.com/policies/terms-of-use"" style=""color: blue;"">Commercial License</a>","English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2024-08-06,False,131072,69.57,1.577,200.0,True
22
+ "<a href=""https://openai.com/api/pricing/"" style=""color: blue;"">gpt-4o-2024-05-13</a>",2.5,10.0,True,True,False,False,https://openai.com/api/pricing/,Commercial License,"<a href=""https://openai.com/policies/terms-of-use"" style=""color: blue;"">Commercial License</a>","English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2024-05-13,False,131072,66.873,3.705,200.0,True
23
+ "<a href=""https://openai.com/api/pricing/"" style=""color: blue;"">gpt-4-1106-vision-preview</a>",10.0,30.0,True,True,False,False,https://openai.com/api/pricing/,Commercial License,"<a href=""https://openai.com/policies/terms-of-use"" style=""color: blue;"">Commercial License</a>","English, Spanish, French, German, Chinese, Japanese, Korean, Italian, Portuguese, Dutch, Russian, Arabic, Hindi, Turkish, Vietnamese, Polish, Thai, Swedish, Danish, Norwegian, Finnish, Hungarian, Czech, Slovak, Romanian, Bulgarian, Ukrainian, Lithuanian, Latvian, Estonian, Slovenian, Malay, Indonesian, Tagalog, Swahili, Amharic",2023-11-06,False,131072,47.23,2.217,1760.0,True
24
+ "<a href=""https://cloud.google.com/vertex-ai/generative-ai/pricing"" style=""color: blue;"">gemini-1.5-flash-latest</a>",0.075,0.3,True,True,True,True,https://cloud.google.com/vertex-ai/generative-ai/pricing,Commercial License,"<a href="""" style=""color: blue;"">Commercial License</a>","Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Thai, Turkish, Ukrainian, Vietnamese, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Arabic, Bengali, Bulgarian",2024-05-24,False,131072,42.537,26.268,1760.0,True
src/process_data.py CHANGED
@@ -81,14 +81,14 @@ df['latency_v1.6.5_ascii'] = df['model_name'].map(latency_map_1_6_5_ascii).filln
81
 
82
 
83
  # Calculate average latency and clemscore
84
- df['average_clemscore'] = df[['clemscore_v1.6.5_multimodal', 'clemscore_v1.6.5_ascii', 'clemscore_v1.6']].mean(axis=1)
85
- df['average_latency'] = df[['latency_v1.6', 'latency_v1.6.5_multimodal', 'latency_v1.6.5_ascii']].mean(axis=1)
86
 
87
 
88
  # More clean up
89
  # Clean and convert prices to float
90
- df['input_price'] = df['input_price'].replace({'\$': '', '': None}, regex=True).astype(float)
91
- df['output_price'] = df['output_price'].replace({'\$': '', '': None}, regex=True).astype(float)
92
 
93
  # Clean and convert additional prices to float
94
  additional_price_columns = [
@@ -103,7 +103,7 @@ additional_price_columns = [
103
  ]
104
 
105
  for col in additional_price_columns:
106
- df[col] = df[col].replace({'\$': '', '': None}, regex=True).astype(float)
107
 
108
  # Clean and convert context to integer
109
  df['context_size'] = df['context_size'].replace({'k': ''}, regex=True).astype(int)
@@ -180,6 +180,29 @@ df = df[[
180
  'estimated'
181
  ]]
182
 
183
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  # Save to CSV
185
  df.to_csv('src/main_df.csv', index=False)
 
81
 
82
 
83
  # Calculate average latency and clemscore
84
+ df['average_clemscore'] = df[['clemscore_v1.6.5_multimodal', 'clemscore_v1.6.5_ascii', 'clemscore_v1.6']].mean(axis=1).round(3)
85
+ df['average_latency'] = df[['latency_v1.6', 'latency_v1.6.5_multimodal', 'latency_v1.6.5_ascii']].mean(axis=1).round(3)
86
 
87
 
88
  # More clean up
89
  # Clean and convert prices to float
90
+ df['input_price'] = df['input_price'].replace({'\$': '', '': None}, regex=True).astype(float).round(3)
91
+ df['output_price'] = df['output_price'].replace({'\$': '', '': None}, regex=True).astype(float).round(3)
92
 
93
  # Clean and convert additional prices to float
94
  additional_price_columns = [
 
103
  ]
104
 
105
  for col in additional_price_columns:
106
+ df[col] = df[col].replace({'\$': '', '': None}, regex=True).astype(float).round(3)
107
 
108
  # Clean and convert context to integer
109
  df['context_size'] = df['context_size'].replace({'k': ''}, regex=True).astype(int)
 
180
  'estimated'
181
  ]]
182
 
183
+ df = df.rename(columns={
184
+ 'model_name': 'Model Name',
185
+ 'input_price': 'Input $/1M',
186
+ 'output_price': 'Output $/1M',
187
+ 'multimodality_image': 'Multimodality Image',
188
+ 'multimodality_multiple_image': 'Multimodality Multiple Image',
189
+ 'multimodality_audio': 'Multimodality Audio',
190
+ 'multimodality_video': 'Multimodality Video',
191
+ 'source': 'Source',
192
+ 'license_name': 'License Name',
193
+ 'license_url': 'License',
194
+ 'languages': 'Languages',
195
+ 'release_date': 'Release Date',
196
+ 'open_weight': 'Open Weight',
197
+ 'context_size': 'Context Size',
198
+ 'average_clemscore': 'Average Clemscore',
199
+ 'average_latency': 'Average Latency (s)',
200
+ 'parameter_size': 'Parameter Size (B)',
201
+ 'estimated': 'Estimated'
202
+ })
203
+
204
+ df['License'] = df.apply(lambda row: f'<a href="{row["License"]}" style="color: blue;">{row["License Name"]}</a>', axis=1)
205
+ df['Model Name'] = df.apply(lambda row: f'<a href="{row["Source"]}" style="color: blue;">{row["Model Name"]}</a>', axis=1)
206
+ print(df)
207
  # Save to CSV
208
  df.to_csv('src/main_df.csv', index=False)
utils/__pycache__/filter_utils.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/filter_utils.cpython-310.pyc and b/utils/__pycache__/filter_utils.cpython-310.pyc differ
 
utils/filter_utils.py CHANGED
@@ -1,29 +1,60 @@
1
  # Utility functions for filtering the dataframe
2
 
 
 
3
  def filter_cols(df):
4
 
5
  df = df[[
6
- 'model_name',
7
- 'input_price',
8
- 'output_price',
9
- 'release_date',
10
- 'context_size',
11
- 'average_clemscore',
12
- 'average_latency',
13
- 'parameter_size',
 
14
  ]]
15
 
16
  return df
17
 
18
 
19
- def filter(df, language_list, clemscore, input_price, output_price):
20
- df = df[df['languages'].apply(lambda x: all(lang in x for lang in language_list))]
21
- df = df[(df['average_clemscore'] >= clemscore[0]) & (df['average_clemscore'] <= clemscore[1])]
22
- df = df[(df['input_price'] >= input_price[0]) & (df['input_price'] <= input_price[1])]
23
- df = df[(df['output_price'] >= output_price[0]) & (df['output_price'] <= output_price[1])]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  df = filter_cols(df)
26
  return df # Return the filtered dataframe
27
 
28
-
29
-
 
1
  # Utility functions for filtering the dataframe
2
 
3
+ import pandas as pd
4
+
5
  def filter_cols(df):
6
 
7
  df = df[[
8
+ 'Model Name',
9
+ 'Input $/1M',
10
+ 'Output $/1M',
11
+ 'Release Date',
12
+ 'Context Size',
13
+ 'Average Clemscore',
14
+ 'Average Latency (s)',
15
+ 'Parameter Size (B)',
16
+ 'License'
17
  ]]
18
 
19
  return df
20
 
21
 
22
+ def filter(df, language_list, parameters, input_price, output_price, multimodal,
23
+ context, open_weight, start, end, license ):
24
+
25
+ df = df[df['Languages'].apply(lambda x: all(lang in x for lang in language_list))]
26
+ df = df[(df['Parameter Size (B)'] >= pow(2, parameters[0])) & (df['Parameter Size (B)'] <= pow(2, parameters[1]))]
27
+ df = df[(df['Input $/1M'] >= input_price[0]) & (df['Input $/1M'] <= input_price[1])]
28
+ df = df[(df['Output $/1M'] >= output_price[0]) & (df['Output $/1M'] <= output_price[1])]
29
+
30
+ if "Image" in multimodal:
31
+ df = df[df['Multimodality Image'] == True]
32
+ if "Multi-Image" in multimodal:
33
+ df = df[df['Multimodality Multiple Image'] == True]
34
+ if "Audio" in multimodal:
35
+ df = df[df['Multimodality Audio'] == True]
36
+ if "Video" in multimodal:
37
+ df = df[df['Multimodality Video'] == True]
38
+
39
+ df = df[(df['Context Size'] >= (2**context[0])*1024) & (df['Context Size'] <= (2**context[1])*1024)]
40
+
41
+ if "Open" in open_weight and "Commercial" not in open_weight:
42
+ df = df[df['Open Weight'] == True]
43
+ elif "Commercial" in open_weight and "Open" not in open_weight:
44
+ df = df[df['Open Weight'] == False]
45
+
46
+ df = df[df['License Name'].apply(lambda x: any(lic in x for lic in license))]
47
+
48
+ # Convert 'Release Date' to int temporarily
49
+ df['Temp Date'] = pd.to_datetime(df['Release Date']).astype(int) // 10**9 # Convert to seconds since epoch
50
+
51
+ # Convert start and end to int (seconds since epoch)
52
+ start = int(pd.to_datetime(start).timestamp())
53
+ end = int(pd.to_datetime(end).timestamp())
54
+
55
+ # Filter based on the converted 'Release Date'
56
+ df = df[(df['Temp Date'] >= start) & (df['Temp Date'] <= end)]
57
 
58
  df = filter_cols(df)
59
  return df # Return the filtered dataframe
60