ivan-savchuk commited on
Commit
a8e52be
β€’
1 Parent(s): d0d3b14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -45,7 +45,8 @@ class DocumentSearch:
45
  return sorted(results, key=lambda x: x['score'], reverse=True)[:k]
46
 
47
 
48
- if __name__ == "__main__":
 
49
  enc_path = "ivan-savchuk/msmarco-distilbert-dot-v5-tuned-full-v1"
50
  idx_path = "idx_vectors.index"
51
  cross_enc_path = "ivan-savchuk/cross-encoder-ms-marco-MiniLM-L-12-v2-tuned_mediqa-v1"
@@ -57,6 +58,12 @@ if __name__ == "__main__":
57
  index_path=idx_path,
58
  cross_encoder_path=cross_enc_path
59
  )
 
 
 
 
 
 
60
  # streamlit part starts here with title
61
  st.title('Medical Search')
62
  # input form
 
45
  return sorted(results, key=lambda x: x['score'], reverse=True)[:k]
46
 
47
 
48
+ @st.cache(suppress_st_warning=True)
49
+ def get_surfer():
50
  enc_path = "ivan-savchuk/msmarco-distilbert-dot-v5-tuned-full-v1"
51
  idx_path = "idx_vectors.index"
52
  cross_enc_path = "ivan-savchuk/cross-encoder-ms-marco-MiniLM-L-12-v2-tuned_mediqa-v1"
 
58
  index_path=idx_path,
59
  cross_encoder_path=cross_enc_path
60
  )
61
+ return surfer
62
+
63
+
64
+ if __name__ == "__main__":
65
+ # get instance of DocumentSearch class
66
+ surfer = get_surfer()
67
  # streamlit part starts here with title
68
  st.title('Medical Search')
69
  # input form