dhmeltzer commited on
Commit
7bf36f0
·
1 Parent(s): de37250

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -44,12 +44,12 @@ My favorite part of the book though was when the hobbits met Tom Bombadil, it's
44
  data=input_data,
45
  headers=headers).json()
46
 
47
- if 0 not in r.keys():
48
- st.write(r)
49
- continue
50
- else:
51
  r=r[0]
52
-
 
 
 
53
  label, score = convert_dict[r['label']], r['score']
54
 
55
  st.write(f"**Model Name**: {model_name}")
 
44
  data=input_data,
45
  headers=headers).json()
46
 
47
+ try:
 
 
 
48
  r=r[0]
49
+ except:
50
+ st.write("Model loading timed out. Please enter the text again.")
51
+ continue
52
+
53
  label, score = convert_dict[r['label']], r['score']
54
 
55
  st.write(f"**Model Name**: {model_name}")