Skip to content

Commit

Permalink
Clear beam search info.
Browse files Browse the repository at this point in the history
  • Loading branch information
popovaan committed Jul 12, 2024
1 parent 165606a commit d26723f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cpp/src/continuous_batching_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class ContinuousBatchingPipeline::Impl {
result.m_status = generation->get_status();
results.push_back(result);
}
m_sampler->clear_beam_search_info();

OPENVINO_ASSERT(results.size() == prompts.size());
return results;
Expand Down
6 changes: 6 additions & 0 deletions src/cpp/src/sampler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ class Sampler {
SamplerOutput sample(std::vector<SequenceGroup::Ptr> & sequence_groups, ov::Tensor logits);

void set_seed(size_t seed) { rng_engine.seed(seed); }

void clear_beam_search_info();
};

SamplerOutput Sampler::sample(std::vector<SequenceGroup::Ptr> & sequence_groups, ov::Tensor logits) {
Expand Down Expand Up @@ -578,4 +580,8 @@ void GroupBeamSearcher::select_next_tokens(const ov::Tensor& logits, SamplerOutp
}
}
}

void Sampler::clear_beam_search_info() {
m_beam_search_info.clear();
}
}

0 comments on commit d26723f

Please sign in to comment.