Ensure the spaces does not fail if no evaluation results are not populated yet
Browse files
app.py
CHANGED
|
@@ -24,9 +24,14 @@ with tab1:
|
|
| 24 |
labels = {dialect: dataset[dialect] for dialect in DIALECTS_WITH_LABELS}
|
| 25 |
|
| 26 |
# Load the models' predictions
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
evaluation_metrics = []
|
| 32 |
for row in model_predictions_rows:
|
|
|
|
| 24 |
labels = {dialect: dataset[dialect] for dialect in DIALECTS_WITH_LABELS}
|
| 25 |
|
| 26 |
# Load the models' predictions
|
| 27 |
+
try:
|
| 28 |
+
model_predictions_rows = datasets.load_dataset(
|
| 29 |
+
os.environ["PREDICTIONS_DATASET_NAME"]
|
| 30 |
+
)["train"]
|
| 31 |
+
|
| 32 |
+
except Exception as e:
|
| 33 |
+
st.error(f"An error occurred while loading the predictions: {e}")
|
| 34 |
+
model_predictions_rows = []
|
| 35 |
|
| 36 |
evaluation_metrics = []
|
| 37 |
for row in model_predictions_rows:
|