Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ede353e

Browse files
committedFeb 20, 2024·
Fixed issue when request is None
1 parent c816e96 commit ede353e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎optimum/intel/openvino/modeling_decoder.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ def prepare_inputs(
419419
# past_key_values are not used explicitly, instead they are handled inside the model
420420
if past_key_values is None:
421421
# This is the first iteration in a sequence, reset all states
422-
self.request.reset_state()
422+
if self.request is not None:
423+
self.request.reset_state()
423424
# Set initial value for the next beam_idx input that will be used at the current iteration
424425
# and will be optionally updated by _reorder_cache at the next iterations if beam_search is used
425426
self.next_beam_idx = np.arange(batch_size, dtype=int)

0 commit comments

Comments
 (0)
Please sign in to comment.