aksj commited on
Commit
134dd66
·
1 Parent(s): d4e3eb1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -48,8 +48,11 @@ def download_spacy_model(model_name):
48
  # return files_names[max_similarity_idx]
49
 
50
  def find_closest(query):
51
- download_spacy_model('en_core_web_md')
52
- nlp = spacy.load('en_core_web_md')
 
 
 
53
  files_names = []
54
  files_vectors = []
55
 
 
48
  # return files_names[max_similarity_idx]
49
 
50
  def find_closest(query):
51
+ try:
52
+ nlp = spacy.load('en_core_web_md')
53
+ except:
54
+ download_spacy_model('en_core_web_md')
55
+ nlp = spacy.load('en_core_web_md')
56
  files_names = []
57
  files_vectors = []
58