Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delta ¶
type Delta struct {
Content *string `json:"content,omitempty"`
}
****************** Universal Generate/Completion Response ***************************
type Model ¶
type Model struct { ModelID string `json:"model_id"` ModelSha string `json:"model_sha"` ModelDtype string `json:"model_dtype"` ModelDeviceType string `json:"model_device_type"` ModelPipelineTag string `json:"model_pipeline_tag"` MaxConcurrentRequests int `json:"max_concurrent_requests"` MaxBestOf int `json:"max_best_of"` MaxStopSequences int `json:"max_stop_sequences"` MaxInputLength int `json:"max_input_length"` MaxTotalTokens int `json:"max_total_tokens"` WaitingServedRatio float64 `json:"waiting_served_ratio"` MaxBatchTotalTokens int `json:"max_batch_total_tokens"` MaxWaitingTokens int `json:"max_waiting_tokens"` ValidationWorkers int `json:"validation_workers"` Version string `json:"version"` DBModelUUID string `json:"-"` LastChecked time.Time `json:"-"` IsActive bool `json:"-"` Host string `json:"-"` UseSSL bool `json:"-"` DontSkipVerifySSL bool `json:"-"` // contains filtered or unexported fields }
type TgiParameters ¶
type TgiParameters struct { MaxNewTokens int `json:"max_new_tokens"` //required Temperature float64 `json:"temperature"` //required TopK int `json:"top_k"` //required TopP float64 `json:"top_p"` //required Stop []string `json:"stop"` //required RepetitionPenalty float64 `json:"repetition_penalty"` //required // BestOf int `json:"best_of"` // DecoderInputDetails bool `json:"decoder_input_details"` Details bool `json:"details"` DoSample bool `json:"do_sample"` ReturnFullText bool `json:"return_full_text"` Seed *int `json:"seed"` Truncate *int `json:"truncate"` TypicalP float64 `json:"typical_p"` Watermark bool `json:"watermark"` }
type TgiRequestBody ¶
type TgiRequestBody struct { Inputs string `json:"inputs"` Parameters TgiParameters `json:"parameters"` }
type UniversalRequest ¶
type UniversalRequest struct { Messages []Message `json:"messages"` Stream bool `json:"stream"` Model string `json:"model"` Temperature float64 `json:"temperature"` TopP float64 `json:"top_p"` N int `json:"n"` Stop string `json:"stop"` PresencePenalty float64 `json:"presence_penalty"` FrequencyPenalty float64 `json:"frequency_penalty"` LogitBias map[string]string `json:"logit_bias"` }
type UniversalResponse ¶
type UniversalResponse struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` Model string `json:"model"` Choices []Choice `json:"choices"` Usage *Usage `json:"usage,omitempty"` }
func DoGenerate ¶
func DoGenerate(uReq *UniversalRequest, model *db.LLMModel, uRespChan chan string) *UniversalResponse
Click to show internal directories.
Click to hide internal directories.