Class NgramSpeculation (1.90.0)

NgramSpeculation(mapping=None, *, ignore_unknown_fields=False, **kwargs)

N-Gram speculation works by trying to find matching tokens in the previous prompt sequence and use those as speculation for generating new tokens.

Attribute

Name Description
ngram_size int
The number of last N input tokens used as ngram to search/match against the previous prompt sequence. This is equal to the N in N-Gram. The default value is 3 if not specified.

Methods

NgramSpeculation

NgramSpeculation(mapping=None, *, ignore_unknown_fields=False, **kwargs)

N-Gram speculation works by trying to find matching tokens in the previous prompt sequence and use those as speculation for generating new tokens.