Documentation
¶
Index ¶
- type Bloomz
- type ModelOption
- type ModelOptions
- type PredictOption
- func SetPenalty(penalty float64) PredictOption
- func SetRepeat(repeat int) PredictOption
- func SetSeed(seed int) PredictOption
- func SetTemperature(temp float64) PredictOption
- func SetThreads(threads int) PredictOption
- func SetTokens(tokens int) PredictOption
- func SetTopK(topk int) PredictOption
- func SetTopP(topp float64) PredictOption
- type PredictOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelOption ¶
type ModelOption func(p *ModelOptions)
var EnableF16Memory ModelOption = func(p *ModelOptions) { p.F16Memory = true }
type ModelOptions ¶
var DefaultModelOptions ModelOptions = ModelOptions{ ContextSize: 512, F16Memory: false, }
func NewModelOptions ¶
func NewModelOptions(opts ...ModelOption) ModelOptions
Create a new PredictOptions object with the given options.
type PredictOption ¶
type PredictOption func(p *PredictOptions)
func SetPenalty ¶
func SetPenalty(penalty float64) PredictOption
SetPenalty sets the repetition penalty for text generation.
func SetRepeat ¶
func SetRepeat(repeat int) PredictOption
SetRepeat sets the number of times to repeat text generation.
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 SetTopP ¶
func SetTopP(topp float64) PredictOption
SetTopP sets the value for nucleus sampling.
type PredictOptions ¶
type PredictOptions struct {
Seed, Threads, Tokens, TopK, Repeat int
TopP, Temperature, Penalty float64
}
var DefaultOptions PredictOptions = PredictOptions{ Seed: -1, Threads: runtime.NumCPU(), Tokens: 128, TopK: 10000, TopP: 0.90, Temperature: 0.96, Penalty: 1, Repeat: 64, }
func NewPredictOptions ¶
func NewPredictOptions(opts ...PredictOption) PredictOptions
Create a new PredictOptions object with the given options.
Click to show internal directories.
Click to hide internal directories.


