gpt2

package module
v0.0.0-...-3eb3a32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dolly

type Dolly struct {
	// contains filtered or unexported fields
}

func NewDolly

func NewDolly(model string) (*Dolly, error)

func (*Dolly) Free

func (l *Dolly) Free()

func (*Dolly) Predict

func (l *Dolly) Predict(text string, opts ...PredictOption) (string, error)

type GPT2

type GPT2 struct {
	// contains filtered or unexported fields
}

func New

func New(model string) (*GPT2, error)

func (*GPT2) Free

func (l *GPT2) Free()

func (*GPT2) Predict

func (l *GPT2) Predict(text string, opts ...PredictOption) (string, error)

type GPTJ

type GPTJ struct {
	// contains filtered or unexported fields
}

func NewGPTJ

func NewGPTJ(model string) (*GPTJ, error)

func (*GPTJ) Free

func (l *GPTJ) Free()

func (*GPTJ) Predict

func (l *GPTJ) Predict(text string, opts ...PredictOption) (string, error)

type GPTNeoX

type GPTNeoX struct {
	// contains filtered or unexported fields
}

func NewGPTNeoX

func NewGPTNeoX(model string) (*GPTNeoX, error)

func (*GPTNeoX) Free

func (l *GPTNeoX) Free()

func (*GPTNeoX) Predict

func (l *GPTNeoX) Predict(text string, opts ...PredictOption) (string, error)

type MPT

type MPT struct {
	// contains filtered or unexported fields
}

func NewMPT

func NewMPT(model string) (*MPT, error)

func (*MPT) Free

func (l *MPT) Free()

func (*MPT) Predict

func (l *MPT) Predict(text string, opts ...PredictOption) (string, error)

type PredictOption

type PredictOption func(p *PredictOptions)

func SetBatch

func SetBatch(size int) PredictOption

SetBatch sets the batch size.

func SetSeed

func SetSeed(seed int) PredictOption

SetSeed sets the random seed for sampling text generation.

func SetTemperature

func SetTemperature(temp float64) PredictOption

SetTemperature sets the temperature value for text generation.

func SetThreads

func SetThreads(threads int) PredictOption

SetThreads sets the number of threads to use for text generation.

func SetTokens

func SetTokens(tokens int) PredictOption

SetTokens sets the number of tokens to generate.

func SetTopK

func SetTopK(topk int) PredictOption

SetTopK sets the value for top-K sampling.

func SetTopP

func SetTopP(topp float64) PredictOption

SetTopP sets the value for nucleus sampling.

type PredictOptions

type PredictOptions struct {
	Seed, Threads, Tokens, TopK, Batch int
	TopP, Temperature                  float64
}
var DefaultOptions PredictOptions = PredictOptions{
	Seed:        -1,
	Threads:     4,
	Tokens:      200,
	TopK:        40,
	TopP:        0.90,
	Temperature: 0.96,
	Batch:       9,
}

func NewPredictOptions

func NewPredictOptions(opts ...PredictOption) PredictOptions

Create a new PredictOptions object with the given options.

type Replit

type Replit struct {
	// contains filtered or unexported fields
}

func NewReplit

func NewReplit(model string) (*Replit, error)

func (*Replit) Free

func (l *Replit) Free()

func (*Replit) Predict

func (l *Replit) Predict(text string, opts ...PredictOption) (string, error)

type Starcoder

type Starcoder struct {
	// contains filtered or unexported fields
}

func NewStarcoder

func NewStarcoder(model string) (*Starcoder, error)

func (*Starcoder) Free

func (l *Starcoder) Free()

func (*Starcoder) Predict

func (l *Starcoder) Predict(text string, opts ...PredictOption) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL