AMR-KELEG commited on
Commit
bd5743f
·
1 Parent(s): f4f96bf

Ensure the spaces does not fail if no evaluation results are not populated yet

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
- model_predictions_rows = datasets.load_dataset(
28
- os.environ["PREDICTIONS_DATASET_NAME"]
29
- )["train"]
 
 
 
 
 
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: