Skip to content

Commit 21ad0f0

Browse files
authored
AC: fix swutch to sync in context window case (#3302)
1 parent 66224ae commit 21ad0f0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/adapters/regression.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ def process(self, raw, identifiers, frame_meta):
130130
Returns:
131131
list of RegressionPrediction objects
132132
"""
133+
134+
self.select_output_blob(raw)
133135
predictions = self._extract_predictions(raw, frame_meta)
134-
self.select_output_blob(predictions)
135136
predictions = predictions[self.output_blob]
136137

137138
result = []
@@ -166,4 +167,4 @@ def select_output_blob(self, outputs):
166167
if self.target_out:
167168
self.output_blob = self.check_output_name(self.target_out, outputs)
168169
if self.output_blob is None:
169-
self.output_blob = next(iter(outputs))
170+
self.output_blob = next(iter(outputs)) if not isinstance(outputs, list) else next(iter(outputs[0]))

tools/accuracy_checker/openvino/tools/accuracy_checker/metrics/question_answering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,4 @@ def evaluate(self, annotations, predictions):
180180
if c_pos_index in index[:self.top_k]:
181181
true_pos += 1
182182

183-
return [true_pos/len(q_pairs)]
183+
return [true_pos/len(q_pairs)] if q_pairs else 0

tools/accuracy_checker/openvino/tools/accuracy_checker/preprocessor/preprocessing_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
preprocessor = Preprocessor.provide(
5656
processor[identifier], config=processor, name=type_
5757
)
58-
if processor[identifier] in MULTI_INFER_PREPROCESSORS:
58+
if processor[identifier] in MULTI_INFER_PREPROCESSORS or getattr(preprocessor, 'to_multi_infer', False):
5959
self._multi_infer_transformations = True
6060

6161
self.processors.append(preprocessor)

0 commit comments

Comments
 (0)