ladapetrushenko commited on
Commit
cd7f7f6
·
1 Parent(s): 905ca72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -56,7 +56,9 @@ if form_button:
56
  else:
57
  model = load_w2v('models/stihi_ru_word2vec.bin')
58
 
59
- if not model['_'.join((target_word, target_word_pos))]:
 
 
60
  st.error("The word you entered is not present in the model")
61
  st.stop()
62
 
 
56
  else:
57
  model = load_w2v('models/stihi_ru_word2vec.bin')
58
 
59
+ try:
60
+ model['_'.join((target_word, target_word_pos))]:
61
+ except KeyError:
62
  st.error("The word you entered is not present in the model")
63
  st.stop()
64