Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrReprocessInputs ¶
func (*ErrReprocessInputs) Error ¶
func (e *ErrReprocessInputs) Error() string
type InputCache ¶
type InputCache struct {
// contains filtered or unexported fields
}
func NewInputCache ¶
func (*InputCache) Close ¶
func (c *InputCache) Close()
func (*InputCache) LoadCacheSlot ¶
func (c *InputCache) LoadCacheSlot(prompt []*input.Input, cachePrompt bool) (*InputCacheSlot, []*input.Input, error)
func (*InputCache) ShiftCacheSlot ¶
func (c *InputCache) ShiftCacheSlot(slot *InputCacheSlot, numKeep int32) error
Frees up space in the KV cache by deleting the oldest half of history and shifting the newest half into that space (saving numKeep inputs at the beginning).
Assumes that at least 1 entry can be freed up by shifting (i.e. numKeep < numCtx)
func (*InputCache) ShiftDiscard ¶
func (c *InputCache) ShiftDiscard(inputLen int32, numKeep int32) int32
TODO(jessegross): If we need to reprocess the inputs we should ensure that we don't split up a SameBatch
type InputCacheSlot ¶
type NewSequenceParams ¶
type NewSequenceParams struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.