mginoben commited on
Commit
1371b6f
·
1 Parent(s): b862f6c

Add error handle for loading model

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -118,8 +118,12 @@ def query(payload):
118
 
119
  def predict(text):
120
  print(preprocess(text))
121
- output = query(preprocess(text))[0]
122
- print(output)
 
 
 
 
123
  output = [tuple(i.values()) for i in output]
124
  output = dict((x, y) for x, y in output)
125
 
 
118
 
119
  def predict(text):
120
  print(preprocess(text))
121
+
122
+ try:
123
+ output = query(preprocess(text))[0]
124
+ except Exception:
125
+ print(output)
126
+
127
  output = [tuple(i.values()) for i in output]
128
  output = dict((x, y) for x, y in output)
129