Skip to content

Commit 10709a3

Browse files
haodeqinavneetrao
authored andcommitted
fix(inference): Exit child process on repeated failure (#9)
1 parent eb6ba31 commit 10709a3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

assistant_dialog_skill_analysis/inferencing/multi_thread_inference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def thread_inference(self):
9595
print('Maximum attempt of {} has reached for query {}'
9696
.format(self.max_retries, query_question))
9797
_thread.interrupt_main()
98+
self.exit()
9899
else:
99100
self.exit()
100101

tests/highlighting/test_highlighting.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,17 @@ def test_filter_results(self):
5555
'no he is an arrogant self serving immature idiot get it right',
5656
None,
5757
'General_Connect_to_Agent',
58-
0.4983435869216919,
58+
0.6697888851165772,
5959
0.09834358692169187,
6060
9)
6161

6262
self.assertEqual(wrong_examples_sorted[0][2], None,
6363
"Test for filter results fail")
64-
self.assertEqual(wrong_examples_sorted[0][4], ground_truth[4],
64+
self.assertEqual(math.isclose(wrong_examples_sorted[0][4],
65+
ground_truth[4],
66+
rel_tol=.01,
67+
abs_tol=.1),
68+
True,
6569
"Test for filter results fail")
6670

6771
def test_generate_adversarial_examples(self):
@@ -131,7 +135,7 @@ def test_get_highlights_in_batch_multi_thread(self):
131135
self.tmpbatchfolder,
132136
0.4,
133137
3)
134-
self.assertEqual(len(os.listdir(self.tmpbatchfolder)), 2,
138+
self.assertEqual(len(os.listdir(self.tmpbatchfolder)), 3,
135139
"# of batch highlighting files is mismatched.")
136140

137141
def tearDown(self):

0 commit comments

Comments
 (0)