llama : std::move llm_bigram_bpe from work_queue

This commit updates the retrieval of llm_bigram_bpe objects from
work_queue.top() by using std::move.

The motivation for this is to avoid the copying of the std::string
`text` member of the llm_bigram_bpe struct.
This commit is contained in:
Daniel Bevenius 2024-08-17 07:06:30 +02:00
parent 8b3befc0e2
commit 6c6db7bcc5
Failed to extract signature

View file

@ -520,7 +520,7 @@ struct llm_tokenizer_bpe {
// build token(s) // build token(s)
while (!work_queue.empty()) { while (!work_queue.empty()) {
auto bigram = work_queue.top(); auto bigram = std::move(const_cast<llm_bigram_bpe&>(work_queue.top()));
work_queue.pop(); work_queue.pop();
auto & left_symbol = symbols[bigram.left]; auto & left_symbol = symbols[bigram.left];