Spaces:
Runtime error
Runtime error
Commit
•
62ab090
1
Parent(s):
06341d7
Update qa_model.py
Browse files- qa_model.py +3 -3
qa_model.py
CHANGED
@@ -13,7 +13,7 @@ from text_utils import *
|
|
13 |
|
14 |
# os.environ['HTTP_PROXY'] = 'http://proxy.hcm.fpt.vn:80'
|
15 |
class QAEnsembleModel_modify(nn.Module):
|
16 |
-
|
17 |
# def __init__(self, model_name, model_checkpoints, entity_dict,
|
18 |
# thr=0.1, device="cuda:0"):
|
19 |
def __init__(self, model_name, entity_dict,
|
@@ -31,11 +31,11 @@ class QAEnsembleModel_modify(nn.Module):
|
|
31 |
self.nlps.append(nlp)
|
32 |
self.entity_dict = entity_dict
|
33 |
self.thr = thr
|
34 |
-
|
35 |
def forward(self, question, texts, ranking_scores=None):
|
36 |
if ranking_scores is None:
|
37 |
ranking_scores = np.ones((len(texts),))
|
38 |
-
|
39 |
curr_answers = []
|
40 |
curr_scores = []
|
41 |
best_score = 0
|
|
|
13 |
|
14 |
# os.environ['HTTP_PROXY'] = 'http://proxy.hcm.fpt.vn:80'
|
15 |
class QAEnsembleModel_modify(nn.Module):
|
16 |
+
|
17 |
# def __init__(self, model_name, model_checkpoints, entity_dict,
|
18 |
# thr=0.1, device="cuda:0"):
|
19 |
def __init__(self, model_name, entity_dict,
|
|
|
31 |
self.nlps.append(nlp)
|
32 |
self.entity_dict = entity_dict
|
33 |
self.thr = thr
|
34 |
+
|
35 |
def forward(self, question, texts, ranking_scores=None):
|
36 |
if ranking_scores is None:
|
37 |
ranking_scores = np.ones((len(texts),))
|
38 |
+
|
39 |
curr_answers = []
|
40 |
curr_scores = []
|
41 |
best_score = 0
|