foxxy-hm commited on
Commit
fbd60cd
·
1 Parent(s): b2f8848

Update src/models/predict_model.py

Browse files
Files changed (1) hide show
  1. src/models/predict_model.py +2 -2
src/models/predict_model.py CHANGED
@@ -23,11 +23,11 @@ title2idx = dict([(x.strip(), y) for x, y in zip(df_wiki.title, df_wiki.index.va
23
 
24
  qa_model = QAEnsembleModel("nguyenvulebinh/vi-mrc-large", ["models/qa_model_robust.bin"], entity_dict)
25
  pairwise_model_stage1 = PairwiseModel("nguyenvulebinh/vi-mrc-base")#.half()
26
- pairwise_model_stage1.load_state_dict(torch.load("models/pairwise_v2.bin"))
27
  pairwise_model_stage1.eval()
28
 
29
  pairwise_model_stage2 = PairwiseModel("nguyenvulebinh/vi-mrc-base")#.half()
30
- pairwise_model_stage2.load_state_dict(torch.load("models/pairwise_stage2_seed0.bin"))
31
 
32
  bm25_model_stage1 = BM25Gensim("models/bm25_stage1/", entity_dict, title2idx)
33
  bm25_model_stage2_full = BM25Gensim("models/bm25_stage2/full_text/", entity_dict, title2idx)
 
23
 
24
  qa_model = QAEnsembleModel("nguyenvulebinh/vi-mrc-large", ["models/qa_model_robust.bin"], entity_dict)
25
  pairwise_model_stage1 = PairwiseModel("nguyenvulebinh/vi-mrc-base")#.half()
26
+ pairwise_model_stage1.load_state_dict(torch.load("models/pairwise_v2.bin", map_location=torch.device('cpu')))
27
  pairwise_model_stage1.eval()
28
 
29
  pairwise_model_stage2 = PairwiseModel("nguyenvulebinh/vi-mrc-base")#.half()
30
+ pairwise_model_stage2.load_state_dict(torch.load("models/pairwise_stage2_seed0.bin", map_location=torch.device('cpu')))
31
 
32
  bm25_model_stage1 = BM25Gensim("models/bm25_stage1/", entity_dict, title2idx)
33
  bm25_model_stage2_full = BM25Gensim("models/bm25_stage2/full_text/", entity_dict, title2idx)