TinyLlama.cpp 1.0
A lightweight C++ implementation of the TinyLlama language model
Loading...
Searching...
No Matches
Public Member Functions | List of all members
llm_bigram_bpe::comparator Struct Reference

#include <tokenizer.h>

Collaboration diagram for llm_bigram_bpe::comparator:
Collaboration graph

Public Member Functions

bool operator() (const llm_bigram_bpe &l, const llm_bigram_bpe &r) const
 

Detailed Description

Definition at line 32 of file tokenizer.h.

Member Function Documentation

◆ operator()()

bool llm_bigram_bpe::comparator::operator() ( const llm_bigram_bpe l,
const llm_bigram_bpe r 
) const
inline

Definition at line 33 of file tokenizer.h.

33 {
34 // Prioritize lower rank (higher priority in BPE merges)
35 // If ranks are equal, prioritize the one starting earlier (lower left index)
36 return l.rank > r.rank || (l.rank == r.rank && l.left > r.left);
37 }
llm_symbol::index left
Definition tokenizer.h:44

References llm_bigram_bpe::left, and llm_bigram_bpe::rank.


The documentation for this struct was generated from the following file: