Skip to content

Commit

Permalink
Merge remote-tracking branch 'popovaan/clear_beam_info' into use-CB-a…
Browse files Browse the repository at this point in the history
…s-backend
  • Loading branch information
Wovchena committed Jul 12, 2024
2 parents 67f4717 + d26723f commit c28a023
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 @@ -272,6 +272,7 @@ class ContinuousBatchingPipeline::Impl {
result.m_status = generation->get_status();
results.push_back(std::move(result));
}
m_sampler->clear_beam_search_info();

OPENVINO_ASSERT(results.size() == input_ids.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 c28a023

Please sign in to comment.