Skip to content

Commit 22cc59d

Browse files
committed
fix(ui): ascending order and default sorting metrics
1 parent 8df1604 commit 22cc59d

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

eg1/ui/demo_streamlit/views/experiments_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def _find_default_sort_metric(columns):
325325
"""
326326
find a sensible default metric for sorting results.
327327
"""
328-
preferred_metrics = ["contextual_relevancy", "judge_notator", "judge_exactness"]
328+
preferred_metrics = ["answer_relevancy", "judge_notator", "judge_exactness"]
329329
for metric in preferred_metrics:
330330
if metric in columns:
331331
return f"{metric}"
@@ -346,7 +346,7 @@ def _sort_score_df(*dfs, reset_index=False):
346346

347347
df = dfs[0]
348348
sorting_metric = _find_default_sort_metric(df.columns)
349-
df.sort_values(by=sorting_metric, key=lambda x: x.map(_extract_mean), ascending=True, inplace=True)
349+
df.sort_values(by=sorting_metric, key=lambda x: x.map(_extract_mean), ascending=False, inplace=True)
350350
# Store the sorted index before resetting it
351351
sorted_idx = df.index.copy()
352352
for df in dfs:

justfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ default:
88
clean:
99
rm -rf build/ eg1.egg-info/
1010

11+
#
12+
# Openai API utils
13+
#
14+
15+
list-albert-model env="prod":
16+
#!/usr/bin/env sh
17+
if [ "{{env}}" = "prod" ]; then
18+
curl -XGET -H "Authorization: Bearer $ALBERT_API_KEY" https://albert.api.etalab.gouv.fr/v1/models | jq '.data.[] | {id, type}'
19+
elif [ "{{env}}" = "staging" ]; then
20+
curl -XGET -H "Authorization: Bearer $ALBERT_API_KEY_STAGING" https://albert.api.staging.etalab.gouv.fr/v1/models | jq '.data.[] | {id, type}'
21+
fi
22+
23+
#
24+
# Alembic commands
25+
#
26+
1127
alembic-init:
1228
alembic -c api/alembic.ini revision --autogenerate -m "Table Initialization"
1329

@@ -24,6 +40,10 @@ alembic-downgrade hash:
2440
alembic-history:
2541
alembic -c api/alembic.ini history
2642

43+
#
44+
# DB Queries
45+
#
46+
2747
[no-cd]
2848
drop-database db_name="eg1_dev":
2949
#!/usr/bin/env python

0 commit comments

Comments
 (0)