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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -56,6 +56,10 @@ if form_button:
56
  else:
57
  model = load_w2v('models/stihi_ru_word2vec.bin')
58
 
 
 
 
 
59
  try:
60
  restrict_vocab = int(restrict_vocab.strip())
61
  except ValueError:
 
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
+
63
  try:
64
  restrict_vocab = int(restrict_vocab.strip())
65
  except ValueError: