ZeroCommand commited on
Commit
b4afb86
1 Parent(s): 0160f4b

Show check config warning

Browse files
Files changed (2) hide show
  1. text_classification_ui_helpers.py +2 -2
  2. wordings.py +4 -0
text_classification_ui_helpers.py CHANGED
@@ -12,7 +12,7 @@ from io_utils import (get_yaml_path, read_column_mapping, save_job_to_pipe,
12
  write_column_mapping, write_log_to_user_file)
13
  from text_classification import (check_model, get_example_prediction,
14
  get_labels_and_features_from_dataset)
15
- from wordings import CONFIRM_MAPPING_DETAILS_FAIL_RAW, MAPPING_STYLED_ERROR_WARNING
16
 
17
  MAX_LABELS = 20
18
  MAX_FEATURES = 20
@@ -131,7 +131,7 @@ def check_model_and_show_prediction(
131
 
132
  # when dataset does not have labels or features
133
  if not isinstance(ds_labels, list) or not isinstance(ds_features, list):
134
- # gr.Warning(CONFIRM_MAPPING_DETAILS_FAIL_RAW)
135
  return (
136
  gr.update(visible=False),
137
  gr.update(visible=False),
 
12
  write_column_mapping, write_log_to_user_file)
13
  from text_classification import (check_model, get_example_prediction,
14
  get_labels_and_features_from_dataset)
15
+ from wordings import CONFIRM_MAPPING_DETAILS_FAIL_RAW, MAPPING_STYLED_ERROR_WARNING, CHECK_CONFIG_OR_SPLIT_RAW
16
 
17
  MAX_LABELS = 20
18
  MAX_FEATURES = 20
 
131
 
132
  # when dataset does not have labels or features
133
  if not isinstance(ds_labels, list) or not isinstance(ds_features, list):
134
+ gr.Warning(CHECK_CONFIG_OR_SPLIT_RAW)
135
  return (
136
  gr.update(visible=False),
137
  gr.update(visible=False),
wordings.py CHANGED
@@ -21,6 +21,10 @@ CONFIRM_MAPPING_DETAILS_FAIL_RAW = """
21
  Sorry, we cannot align the input/output of your dataset with the model. Pleaser double check your model and dataset.
22
  """
23
 
 
 
 
 
24
  PREDICTION_SAMPLE_MD = """
25
  <h1 style="text-align: center;">
26
  Model Prediction Sample
 
21
  Sorry, we cannot align the input/output of your dataset with the model. Pleaser double check your model and dataset.
22
  """
23
 
24
+ CHECK_CONFIG_OR_SPLIT_RAW = """
25
+ Please check your dataset config or split.
26
+ """
27
+
28
  PREDICTION_SAMPLE_MD = """
29
  <h1 style="text-align: center;">
30
  Model Prediction Sample