Noha90 commited on
Commit
ffade47
·
1 Parent(s): 7cd9f1e

add an error

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -30,6 +30,9 @@ def index():
30
  print("Tokenized:", tokenizer.tokenize(input_text))
31
  predictions = nlp(input_text)
32
  print("Predictions:", predictions)
 
 
 
33
 
34
  log_entry = {
35
  "timestamp": str(datetime.datetime.now()),
 
30
  print("Tokenized:", tokenizer.tokenize(input_text))
31
  predictions = nlp(input_text)
32
  print("Predictions:", predictions)
33
+ if not predictions:
34
+ return "Error: No medical abbreviation detected in the input.", 400
35
+
36
 
37
  log_entry = {
38
  "timestamp": str(datetime.datetime.now()),