Spaces:
Build error
Build error
Sasha
commited on
Commit
·
6bd8b05
1
Parent(s):
a411b51
adding a catch for no metrics selected
Browse files
app.py
CHANGED
|
@@ -25,14 +25,19 @@ with st.sidebar.expander("Compare one or more metrics", expanded=True):
|
|
| 25 |
metrics,
|
| 26 |
default="rouge")
|
| 27 |
|
|
|
|
| 28 |
loaded_metrics= []
|
| 29 |
for metric in metric_names:
|
| 30 |
metric = load_metric(metric)
|
| 31 |
loaded_metrics.append(metric)
|
| 32 |
|
|
|
|
| 33 |
### Single metric mode
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
metric_name = metric_names[0]
|
| 37 |
st.markdown("# You chose " + metric_name.upper())
|
| 38 |
|
|
|
|
| 25 |
metrics,
|
| 26 |
default="rouge")
|
| 27 |
|
| 28 |
+
|
| 29 |
loaded_metrics= []
|
| 30 |
for metric in metric_names:
|
| 31 |
metric = load_metric(metric)
|
| 32 |
loaded_metrics.append(metric)
|
| 33 |
|
| 34 |
+
|
| 35 |
### Single metric mode
|
| 36 |
+
print(metric_names)
|
| 37 |
+
if metric_names == []:
|
| 38 |
+
st.markdown("## Please choose one or more metrics.")
|
| 39 |
|
| 40 |
+
elif len(metric_names) == 1:
|
| 41 |
metric_name = metric_names[0]
|
| 42 |
st.markdown("# You chose " + metric_name.upper())
|
| 43 |
|