pszemraj commited on
Commit
50d040d
1 Parent(s): 16de73c

🚸 catch inputs with no text

Browse files

Signed-off-by: peter szemraj <[email protected]>

Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -91,11 +91,15 @@ def proc_submission(
91
  <div style="background-color: #880808; color: white; padding: 20px;">
92
  <h3>Warning</h3>
93
  <p>Input text is too short to summarize. Detected {len(input_text)} characters.
94
- Check your input as strange things may happen.</p>
95
  </div>
96
  """
97
  logging.warning(msg)
 
98
  history["WARNING"] = msg
 
 
 
99
  _summaries = summarize_via_tokenbatches(
100
  tr_in,
101
  model_sm if "base" in model_size.lower() else model,
 
91
  <div style="background-color: #880808; color: white; padding: 20px;">
92
  <h3>Warning</h3>
93
  <p>Input text is too short to summarize. Detected {len(input_text)} characters.
94
+ Please load text by selecting an example from the dropdown menu or by pasting text into the text box.</p>
95
  </div>
96
  """
97
  logging.warning(msg)
98
+ logging.warning("RETURNING EMPTY STRING")
99
  history["WARNING"] = msg
100
+
101
+ return msg, "", []
102
+
103
  _summaries = summarize_via_tokenbatches(
104
  tr_in,
105
  model_sm if "base" in model_size.lower() else model,