Merge pull request #55 from jmorganca/fix-run-generate

fix run generate
This commit is contained in:
Michael Yang 2023-07-07 11:37:56 -07:00 committed by GitHub
commit ba2bade0d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,55 +32,55 @@ type GenerateRequest struct {
Model string `json:"model"` Model string `json:"model"`
Prompt string `json:"prompt"` Prompt string `json:"prompt"`
ModelOptions `json:"model_opts"` ModelOptions `json:"model_opts,omitempty"`
PredictOptions `json:"predict_opts"` PredictOptions `json:"predict_opts,omitempty"`
} }
type ModelOptions struct { type ModelOptions struct {
ContextSize int `json:"context_size"` ContextSize int `json:"context_size,omitempty"`
Seed int `json:"seed"` Seed int `json:"seed,omitempty"`
NBatch int `json:"n_batch"` NBatch int `json:"n_batch,omitempty"`
F16Memory bool `json:"memory_f16"` F16Memory bool `json:"memory_f16,omitempty"`
MLock bool `json:"mlock"` MLock bool `json:"mlock,omitempty"`
MMap bool `json:"mmap"` MMap bool `json:"mmap,omitempty"`
VocabOnly bool `json:"vocab_only"` VocabOnly bool `json:"vocab_only,omitempty"`
LowVRAM bool `json:"low_vram"` LowVRAM bool `json:"low_vram,omitempty"`
Embeddings bool `json:"embeddings"` Embeddings bool `json:"embeddings,omitempty"`
NUMA bool `json:"numa"` NUMA bool `json:"numa,omitempty"`
NGPULayers int `json:"gpu_layers"` NGPULayers int `json:"gpu_layers,omitempty"`
MainGPU string `json:"main_gpu"` MainGPU string `json:"main_gpu,omitempty"`
TensorSplit string `json:"tensor_split"` TensorSplit string `json:"tensor_split,omitempty"`
} }
type PredictOptions struct { type PredictOptions struct {
Seed int `json:"seed"` Seed int `json:"seed,omitempty"`
Threads int `json:"threads"` Threads int `json:"threads,omitempty"`
Tokens int `json:"tokens"` Tokens int `json:"tokens,omitempty"`
TopK int `json:"top_k"` TopK int `json:"top_k,omitempty"`
Repeat int `json:"repeat"` Repeat int `json:"repeat,omitempty"`
Batch int `json:"batch"` Batch int `json:"batch,omitempty"`
NKeep int `json:"nkeep"` NKeep int `json:"nkeep,omitempty"`
TopP float64 `json:"top_p"` TopP float64 `json:"top_p,omitempty"`
Temperature float64 `json:"temp"` Temperature float64 `json:"temp,omitempty"`
Penalty float64 `json:"penalty"` Penalty float64 `json:"penalty,omitempty"`
F16KV bool F16KV bool
DebugMode bool DebugMode bool
StopPrompts []string StopPrompts []string
IgnoreEOS bool `json:"ignore_eos"` IgnoreEOS bool `json:"ignore_eos,omitempty"`
TailFreeSamplingZ float64 `json:"tfs_z"` TailFreeSamplingZ float64 `json:"tfs_z,omitempty"`
TypicalP float64 `json:"typical_p"` TypicalP float64 `json:"typical_p,omitempty"`
FrequencyPenalty float64 `json:"freq_penalty"` FrequencyPenalty float64 `json:"freq_penalty,omitempty"`
PresencePenalty float64 `json:"pres_penalty"` PresencePenalty float64 `json:"pres_penalty,omitempty"`
Mirostat int `json:"mirostat"` Mirostat int `json:"mirostat,omitempty"`
MirostatETA float64 `json:"mirostat_lr"` MirostatETA float64 `json:"mirostat_lr,omitempty"`
MirostatTAU float64 `json:"mirostat_ent"` MirostatTAU float64 `json:"mirostat_ent,omitempty"`
PenalizeNL bool `json:"penalize_nl"` PenalizeNL bool `json:"penalize_nl,omitempty"`
LogitBias string `json:"logit_bias"` LogitBias string `json:"logit_bias,omitempty"`
PathPromptCache string PathPromptCache string
MLock bool `json:"mlock"` MLock bool `json:"mlock,omitempty"`
MMap bool `json:"mmap"` MMap bool `json:"mmap,omitempty"`
PromptCacheAll bool PromptCacheAll bool
PromptCacheRO bool PromptCacheRO bool
MainGPU string MainGPU string