pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::StripDecoder Class Reference

Removes up to start leading and stop trailing copies of a character from every token (Hugging Face's Strip decoder). More...

#include <sentencepiece_bpe.hpp>

Inheritance diagram for pulsatrix::StripDecoder:
Collaboration diagram for pulsatrix::StripDecoder:

Public Member Functions

 StripDecoder (std::string content, size_t start, size_t stop)
 
std::vector< std::string > decode_chain (std::vector< std::string > tokens) const override
 The tokens after this decoder: by default decode()'s text as one token.
 
- Public Member Functions inherited from pulsatrix::Decoder
virtual ~Decoder ()=default
 
virtual std::string decode (const std::vector< std::string > &tokens) const
 The decoded text: decode_chain() joined.
 

Detailed Description

Removes up to start leading and stop trailing copies of a character from every token (Hugging Face's Strip decoder).

Constructor & Destructor Documentation

◆ StripDecoder()

pulsatrix::StripDecoder::StripDecoder ( std::string  content,
size_t  start,
size_t  stop 
)

Member Function Documentation

◆ decode_chain()

std::vector< std::string > pulsatrix::StripDecoder::decode_chain ( std::vector< std::string >  tokens) const
overridevirtual

The tokens after this decoder: by default decode()'s text as one token.

Reimplemented from pulsatrix::Decoder.


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