Spaces:
Sleeping
Sleeping
justinxzhao
commited on
Commit
·
16d72cb
1
Parent(s):
38e43b5
Fix all warnings.
Browse files
app.py
CHANGED
@@ -189,13 +189,24 @@ def create_dataframe_for_direct_assessment_judging_response(
|
|
189 |
def render_criteria_form(criteria_num):
|
190 |
"""Render a criteria input form."""
|
191 |
with st.expander(f"Criteria {criteria_num + 1}"):
|
192 |
-
name = st.text_input(
|
193 |
-
|
|
|
|
|
|
|
|
|
|
|
194 |
min_score = st.number_input(
|
195 |
-
f"Min Score for Criteria {criteria_num + 1}",
|
|
|
|
|
|
|
196 |
)
|
197 |
max_score = st.number_input(
|
198 |
-
f"Max Score for Criteria {criteria_num + 1}",
|
|
|
|
|
|
|
199 |
)
|
200 |
return Criteria(
|
201 |
name=name, description=description, min_score=min_score, max_score=max_score
|
@@ -390,9 +401,11 @@ def plot_overall_scores(overall_scores_df):
|
|
390 |
ax = sns.barplot(
|
391 |
x="ui_friendly_name",
|
392 |
y="mean_score",
|
|
|
393 |
data=summary,
|
394 |
palette="prism",
|
395 |
capsize=0.1,
|
|
|
396 |
)
|
397 |
|
398 |
# Add error bars manually
|
@@ -525,7 +538,9 @@ def main():
|
|
525 |
st.markdown("#### Enter your prompt")
|
526 |
_, center_column, _ = st.columns([3, 5, 3])
|
527 |
with center_column:
|
528 |
-
user_prompt = st.text_area(
|
|
|
|
|
529 |
|
530 |
if center_column.button("Submit", use_container_width=True):
|
531 |
st.markdown("#### Responses")
|
@@ -632,6 +647,7 @@ def main():
|
|
632 |
"Prompt for the Direct Assessment",
|
633 |
value=get_default_direct_assessment_prompt(user_prompt=user_prompt),
|
634 |
height=500,
|
|
|
635 |
)
|
636 |
|
637 |
# TODO: Add option to edit criteria list with a basic text field.
|
|
|
189 |
def render_criteria_form(criteria_num):
|
190 |
"""Render a criteria input form."""
|
191 |
with st.expander(f"Criteria {criteria_num + 1}"):
|
192 |
+
name = st.text_input(
|
193 |
+
f"Name for Criteria {criteria_num + 1}", key=f"criteria_name_{criteria_num}"
|
194 |
+
)
|
195 |
+
description = st.text_area(
|
196 |
+
f"Description for Criteria {criteria_num + 1}",
|
197 |
+
key=f"criteria_desc_{criteria_num}",
|
198 |
+
)
|
199 |
min_score = st.number_input(
|
200 |
+
f"Min Score for Criteria {criteria_num + 1}",
|
201 |
+
min_value=0,
|
202 |
+
step=1,
|
203 |
+
key=f"criteria_min_{criteria_num}",
|
204 |
)
|
205 |
max_score = st.number_input(
|
206 |
+
f"Max Score for Criteria {criteria_num + 1}",
|
207 |
+
min_value=0,
|
208 |
+
step=1,
|
209 |
+
key=f"criteria_max_{criteria_num}",
|
210 |
)
|
211 |
return Criteria(
|
212 |
name=name, description=description, min_score=min_score, max_score=max_score
|
|
|
401 |
ax = sns.barplot(
|
402 |
x="ui_friendly_name",
|
403 |
y="mean_score",
|
404 |
+
hue="ui_friendly_name", # Add this line
|
405 |
data=summary,
|
406 |
palette="prism",
|
407 |
capsize=0.1,
|
408 |
+
legend=False, # Add this line
|
409 |
)
|
410 |
|
411 |
# Add error bars manually
|
|
|
538 |
st.markdown("#### Enter your prompt")
|
539 |
_, center_column, _ = st.columns([3, 5, 3])
|
540 |
with center_column:
|
541 |
+
user_prompt = st.text_area(
|
542 |
+
"Enter your prompt", value="Say 'Hello World'", key="user_prompt"
|
543 |
+
)
|
544 |
|
545 |
if center_column.button("Submit", use_container_width=True):
|
546 |
st.markdown("#### Responses")
|
|
|
647 |
"Prompt for the Direct Assessment",
|
648 |
value=get_default_direct_assessment_prompt(user_prompt=user_prompt),
|
649 |
height=500,
|
650 |
+
key="direct_assessment_prompt",
|
651 |
)
|
652 |
|
653 |
# TODO: Add option to edit criteria list with a basic text field.
|