Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = PredictOptions{ Model: "gpt2", MaxTokens: 200, Temperature: 0.96, StopWords: nil, }
Functions ¶
This section is empty.
Types ¶
type HuggingFace ¶
type HuggingFace struct {
// contains filtered or unexported fields
}
func NewHuggingFace ¶
func NewHuggingFace(repoId string) (*HuggingFace, error)
func (*HuggingFace) PredictHuggingFace ¶
func (s *HuggingFace) PredictHuggingFace(text string, opts ...PredictOption) (*Predict, error)
type PredictOption ¶
type PredictOption func(p *PredictOptions)
func SetMaxTokens ¶
func SetMaxTokens(maxTokens int) PredictOption
func SetModel ¶
func SetModel(model string) PredictOption
func SetStopWords ¶
func SetStopWords(stopWords []string) PredictOption
func SetTemperature ¶
func SetTemperature(temperature float64) PredictOption
type PredictOptions ¶
type PredictOptions struct { Model string `json:"model"` // MaxTokens is the maximum number of tokens to generate. MaxTokens int `json:"max_tokens"` // Temperature is the temperature for sampling, between 0 and 1. Temperature float64 `json:"temperature"` // StopWords is a list of words to stop on. StopWords []string `json:"stop_words"` }
func NewPredictOptions ¶
func NewPredictOptions(opts ...PredictOption) PredictOptions
NewPredictOptions Create a new PredictOptions object with the given options.
Click to show internal directories.
Click to hide internal directories.