Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
refactor: move the column names to a seperated file
Browse files- app.py +2 -7
- src/display/column_names.py +9 -0
- src/display/utils.py +3 -11
- src/read_evals.py +4 -10
- src/utils.py +3 -2
- tests/test_utils.py +2 -1
app.py
CHANGED
@@ -18,13 +18,8 @@ from src.benchmarks import (
|
|
18 |
DEFAULT_METRIC_LONG_DOC
|
19 |
)
|
20 |
from src.display.css_html_js import custom_css
|
21 |
-
from src.display.
|
22 |
-
COL_NAME_IS_ANONYMOUS
|
23 |
-
COL_NAME_REVISION,
|
24 |
-
COL_NAME_TIMESTAMP,
|
25 |
-
COL_NAME_RERANKING_MODEL,
|
26 |
-
COL_NAME_RETRIEVAL_MODEL
|
27 |
-
)
|
28 |
from src.envs import (
|
29 |
API,
|
30 |
EVAL_RESULTS_PATH,
|
|
|
18 |
DEFAULT_METRIC_LONG_DOC
|
19 |
)
|
20 |
from src.display.css_html_js import custom_css
|
21 |
+
from src.display.column_names import COL_NAME_RETRIEVAL_MODEL, COL_NAME_RERANKING_MODEL, COL_NAME_REVISION, \
|
22 |
+
COL_NAME_TIMESTAMP, COL_NAME_IS_ANONYMOUS
|
|
|
|
|
|
|
|
|
|
|
23 |
from src.envs import (
|
24 |
API,
|
25 |
EVAL_RESULTS_PATH,
|
src/display/column_names.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
COL_NAME_AVG = "Average ⬆️"
|
2 |
+
COL_NAME_RETRIEVAL_MODEL = "Retrieval Method"
|
3 |
+
COL_NAME_RERANKING_MODEL = "Reranking Model"
|
4 |
+
COL_NAME_RETRIEVAL_MODEL_LINK = "Retrieval Model LINK"
|
5 |
+
COL_NAME_RERANKING_MODEL_LINK = "Reranking Model LINK"
|
6 |
+
COL_NAME_RANK = "Rank 🏆"
|
7 |
+
COL_NAME_REVISION = "Revision"
|
8 |
+
COL_NAME_TIMESTAMP = "Submission Date"
|
9 |
+
COL_NAME_IS_ANONYMOUS = "Anonymous Submission"
|
src/display/utils.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
from dataclasses import dataclass, make_dataclass
|
2 |
|
3 |
from src.benchmarks import BenchmarksQA, BenchmarksLongDoc
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
def fields(raw_class):
|
@@ -19,17 +22,6 @@ class ColumnContent:
|
|
19 |
never_hidden: bool = False
|
20 |
|
21 |
|
22 |
-
COL_NAME_AVG = "Average ⬆️"
|
23 |
-
COL_NAME_RETRIEVAL_MODEL = "Retrieval Method"
|
24 |
-
COL_NAME_RERANKING_MODEL = "Reranking Model"
|
25 |
-
COL_NAME_RETRIEVAL_MODEL_LINK = "Retrieval Model LINK"
|
26 |
-
COL_NAME_RERANKING_MODEL_LINK = "Reranking Model LINK"
|
27 |
-
COL_NAME_RANK = "Rank 🏆"
|
28 |
-
COL_NAME_REVISION = "Revision"
|
29 |
-
COL_NAME_TIMESTAMP = "Submission Date"
|
30 |
-
COL_NAME_IS_ANONYMOUS = "Anonymous Submission"
|
31 |
-
|
32 |
-
|
33 |
def get_default_auto_eval_column_dict():
|
34 |
auto_eval_column_dict = []
|
35 |
# Init
|
|
|
1 |
from dataclasses import dataclass, make_dataclass
|
2 |
|
3 |
from src.benchmarks import BenchmarksQA, BenchmarksLongDoc
|
4 |
+
from src.display.column_names import COL_NAME_AVG, COL_NAME_RETRIEVAL_MODEL, COL_NAME_RERANKING_MODEL, \
|
5 |
+
COL_NAME_RETRIEVAL_MODEL_LINK, COL_NAME_RERANKING_MODEL_LINK, COL_NAME_RANK, COL_NAME_REVISION, COL_NAME_TIMESTAMP, \
|
6 |
+
COL_NAME_IS_ANONYMOUS
|
7 |
|
8 |
|
9 |
def fields(raw_class):
|
|
|
22 |
never_hidden: bool = False
|
23 |
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
def get_default_auto_eval_column_dict():
|
26 |
auto_eval_column_dict = []
|
27 |
# Init
|
src/read_evals.py
CHANGED
@@ -8,20 +8,14 @@ import pandas as pd
|
|
8 |
|
9 |
from src.benchmarks import get_safe_name
|
10 |
from src.display.utils import (
|
11 |
-
COL_NAME_RERANKING_MODEL,
|
12 |
-
COL_NAME_RETRIEVAL_MODEL,
|
13 |
-
COL_NAME_RERANKING_MODEL_LINK,
|
14 |
-
COL_NAME_RETRIEVAL_MODEL_LINK,
|
15 |
-
COL_NAME_REVISION,
|
16 |
-
COL_NAME_TIMESTAMP,
|
17 |
-
COL_NAME_IS_ANONYMOUS,
|
18 |
COLS_QA,
|
19 |
QA_BENCHMARK_COLS,
|
20 |
COLS_LONG_DOC,
|
21 |
-
LONG_DOC_BENCHMARK_COLS
|
22 |
-
COL_NAME_AVG,
|
23 |
-
COL_NAME_RANK
|
24 |
)
|
|
|
|
|
|
|
25 |
|
26 |
from src.display.formatting import make_clickable_model
|
27 |
|
|
|
8 |
|
9 |
from src.benchmarks import get_safe_name
|
10 |
from src.display.utils import (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
COLS_QA,
|
12 |
QA_BENCHMARK_COLS,
|
13 |
COLS_LONG_DOC,
|
14 |
+
LONG_DOC_BENCHMARK_COLS
|
|
|
|
|
15 |
)
|
16 |
+
from src.display.column_names import COL_NAME_AVG, COL_NAME_RETRIEVAL_MODEL, COL_NAME_RERANKING_MODEL, \
|
17 |
+
COL_NAME_RETRIEVAL_MODEL_LINK, COL_NAME_RERANKING_MODEL_LINK, COL_NAME_RANK, COL_NAME_REVISION, COL_NAME_TIMESTAMP, \
|
18 |
+
COL_NAME_IS_ANONYMOUS
|
19 |
|
20 |
from src.display.formatting import make_clickable_model
|
21 |
|
src/utils.py
CHANGED
@@ -8,8 +8,9 @@ import pandas as pd
|
|
8 |
|
9 |
from src.benchmarks import BENCHMARK_COLS_QA, BENCHMARK_COLS_LONG_DOC, BenchmarksQA, BenchmarksLongDoc
|
10 |
from src.display.formatting import styled_message, styled_error
|
11 |
-
from src.display.utils import COLS_QA, TYPES_QA, COLS_LONG_DOC, TYPES_LONG_DOC,
|
12 |
-
|
|
|
13 |
from src.envs import API, SEARCH_RESULTS_REPO, LATEST_BENCHMARK_VERSION
|
14 |
from src.read_evals import FullEvalResult, get_leaderboard_df, calculate_mean
|
15 |
|
|
|
8 |
|
9 |
from src.benchmarks import BENCHMARK_COLS_QA, BENCHMARK_COLS_LONG_DOC, BenchmarksQA, BenchmarksLongDoc
|
10 |
from src.display.formatting import styled_message, styled_error
|
11 |
+
from src.display.utils import COLS_QA, TYPES_QA, COLS_LONG_DOC, TYPES_LONG_DOC, get_default_auto_eval_column_dict
|
12 |
+
from src.display.column_names import COL_NAME_AVG, COL_NAME_RETRIEVAL_MODEL, COL_NAME_RERANKING_MODEL, COL_NAME_RANK, \
|
13 |
+
COL_NAME_REVISION, COL_NAME_TIMESTAMP, COL_NAME_IS_ANONYMOUS
|
14 |
from src.envs import API, SEARCH_RESULTS_REPO, LATEST_BENCHMARK_VERSION
|
15 |
from src.read_evals import FullEvalResult, get_leaderboard_df, calculate_mean
|
16 |
|
tests/test_utils.py
CHANGED
@@ -2,7 +2,8 @@ import pandas as pd
|
|
2 |
import pytest
|
3 |
|
4 |
from src.utils import filter_models, search_table, filter_queries, select_columns, update_table_long_doc, get_iso_format_timestamp, get_default_cols, update_table
|
5 |
-
from src.display.
|
|
|
6 |
|
7 |
|
8 |
@pytest.fixture
|
|
|
2 |
import pytest
|
3 |
|
4 |
from src.utils import filter_models, search_table, filter_queries, select_columns, update_table_long_doc, get_iso_format_timestamp, get_default_cols, update_table
|
5 |
+
from src.display.column_names import COL_NAME_AVG, COL_NAME_RETRIEVAL_MODEL, COL_NAME_RERANKING_MODEL, COL_NAME_RANK, \
|
6 |
+
COL_NAME_REVISION, COL_NAME_TIMESTAMP, COL_NAME_IS_ANONYMOUS
|
7 |
|
8 |
|
9 |
@pytest.fixture
|