-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
310 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
sotopia/ui/streamlit_ui/pages/display_evaluation_dimensions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import streamlit as st | ||
|
||
from sotopia.database import CustomEvaluationDimension | ||
|
||
from sotopia.ui.streamlit_ui.rendering import ( | ||
get_evaluation_dimensions, | ||
render_evaluation_dimension, | ||
get_distinct_evaluation_dimensions, | ||
render_evaluation_dimension_list, | ||
) | ||
|
||
st.title("Evaluation Dimensions") | ||
|
||
st.write("Here are some instructions about using the evaluation dimension renderer.") | ||
|
||
|
||
def display_evaluation_dimensions() -> None: | ||
# st.title("Evaluation Dimensions") | ||
distinct_dimensions: list[CustomEvaluationDimension] = ( | ||
get_distinct_evaluation_dimensions() | ||
) | ||
|
||
# sort the dimensions by name | ||
distinct_dimensions.sort(key=lambda x: x.name) | ||
|
||
with st.expander("Evaluation Dimensions", expanded=True): | ||
all_dimensions = [] | ||
col1, col2 = st.columns(2, gap="medium") | ||
for i, dimension in enumerate(distinct_dimensions): | ||
with col1 if i % 2 == 0 else col2: | ||
render_evaluation_dimension(dimension) | ||
|
||
with st.expander("Evaluation Dimension Lists", expanded=True): | ||
all_dimension_lists: dict[str, list[CustomEvaluationDimension]] = ( | ||
get_evaluation_dimensions() | ||
) | ||
col1, col2 = st.columns(2, gap="medium") | ||
for i, (dimension_list_name, dimensions) in enumerate( | ||
all_dimension_lists.items() | ||
): | ||
all_dimensions: list[CustomEvaluationDimension] = [ | ||
CustomEvaluationDimension(**dimension) for dimension in dimensions | ||
] | ||
with col1 if i % 2 == 0 else col2: | ||
render_evaluation_dimension_list(dimension_list_name, all_dimensions) | ||
|
||
|
||
display_evaluation_dimensions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.