mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-10-29 12:51:09 +00:00
fixed bindings to match new API (#2240)
* fixed bindings to match new API Signed-off-by: Jerry Caligiure <jerry@noof.biz> * added update to readme Signed-off-by: Jerry Caligiure <jerry@noof.biz> --------- Signed-off-by: Jerry Caligiure <jerry@noof.biz> Co-authored-by: Jerry Caligiure <jerry@noof.biz>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package gpt4all
|
||||
|
||||
type PredictOptions struct {
|
||||
ContextSize, RepeatLastN, Tokens, TopK, Batch int
|
||||
TopP, MinP, Temperature, ContextErase, RepeatPenalty float64
|
||||
ContextSize, RepeatLastN, Tokens, TopK, Batch, Special int
|
||||
TopP, MinP, Temperature, ContextErase, RepeatPenalty float64
|
||||
}
|
||||
|
||||
type PredictOption func(p *PredictOptions)
|
||||
@@ -11,9 +11,10 @@ var DefaultOptions PredictOptions = PredictOptions{
|
||||
Tokens: 200,
|
||||
TopK: 10,
|
||||
TopP: 0.90,
|
||||
MinP: 0.0,
|
||||
MinP: 0.0,
|
||||
Temperature: 0.96,
|
||||
Batch: 1,
|
||||
Special: 0,
|
||||
ContextErase: 0.55,
|
||||
ContextSize: 1024,
|
||||
RepeatLastN: 10,
|
||||
@@ -93,6 +94,17 @@ func SetBatch(size int) PredictOption {
|
||||
}
|
||||
}
|
||||
|
||||
// SetSpecial is true if special tokens in the prompt should be processed, false otherwise.
|
||||
func SetSpecial(special bool) PredictOption {
|
||||
return func(p *PredictOptions) {
|
||||
if special {
|
||||
p.Special = 1
|
||||
} else {
|
||||
p.Special = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create a new PredictOptions object with the given options.
|
||||
func NewPredictOptions(opts ...PredictOption) PredictOptions {
|
||||
p := DefaultOptions
|
||||
|
||||
Reference in New Issue
Block a user