yinlinfu commited on
Commit
e10e810
·
1 Parent(s): da1082e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -61,12 +61,11 @@ cross_encoder = CrossEncoder(option2, device='cpu')
61
  passages = []
62
 
63
  # load pre-train embeedings files
64
- embedding_cache_path = 'etsy-embeddings-gpu-total-0530.pkl'
65
  print("Load pre-computed embeddings from disc")
66
- with open(embedding_cache_path, "rb") as fIn:
67
- cache_data = pickle.load(fIn)
68
- passages = cache_data['sentences']
69
- corpus_embeddings = cache_data['embeddings']
70
 
71
  from rank_bm25 import BM25Okapi
72
  from sklearn.feature_extraction import _stop_words
 
61
  passages = []
62
 
63
  # load pre-train embeedings files
 
64
  print("Load pre-computed embeddings from disc")
65
+ embedding_cache_path = 'embeddings.pt'
66
+ corpus_embeddings = torch.load(embedding_cache_path)
67
+ with open('sentences.json', 'r') as file:
68
+ passages = json.load(file)
69
 
70
  from rank_bm25 import BM25Okapi
71
  from sklearn.feature_extraction import _stop_words