Documentation
¶
Index ¶
- Constants
- Variables
- type HuggingFace
- func (h *HuggingFace) BatchCompletion(ctx context.Context, prompts []string) ([]string, error)
- func (h *HuggingFace) Completion(ctx context.Context, prompt string) (string, error)
- func (h *HuggingFace) WithHTTPClient(httpClient *http.Client) *HuggingFace
- func (h *HuggingFace) WithMaxLength(maxLength int) *HuggingFace
- func (h *HuggingFace) WithMinLength(minLength int) *HuggingFace
- func (h *HuggingFace) WithMode(mode Mode) *HuggingFace
- func (h *HuggingFace) WithModel(model string) *HuggingFace
- func (h *HuggingFace) WithTemperature(temperature float32) *HuggingFace
- func (h *HuggingFace) WithToken(token string) *HuggingFace
- func (h *HuggingFace) WithTopK(topK int) *HuggingFace
- func (h *HuggingFace) WithTopP(topP float32) *HuggingFace
- func (h *HuggingFace) WithVerbose(verbose bool) *HuggingFace
- type Mode
Constants ¶
View Source
const APIBaseURL = "https://api-inference.huggingface.co/models/"
Variables ¶
View Source
var (
ErrHuggingFaceCompletion = errors.New("huggingface completion error")
)
Functions ¶
This section is empty.
Types ¶
type HuggingFace ¶ added in v0.0.9
type HuggingFace struct {
// contains filtered or unexported fields
}
func (*HuggingFace) BatchCompletion ¶ added in v0.0.10
BatchCompletion returns the completion for the given prompts
func (*HuggingFace) Completion ¶ added in v0.0.9
Completion returns the completion for the given prompt
func (*HuggingFace) WithHTTPClient ¶ added in v0.0.11
func (h *HuggingFace) WithHTTPClient(httpClient *http.Client) *HuggingFace
WithHTTPClient sets the http client to use for the LLM
func (*HuggingFace) WithMaxLength ¶ added in v0.0.9
func (h *HuggingFace) WithMaxLength(maxLength int) *HuggingFace
WithMaxLength sets the maxLength to use for the LLM
func (*HuggingFace) WithMinLength ¶ added in v0.0.9
func (h *HuggingFace) WithMinLength(minLength int) *HuggingFace
WithMinLength sets the minLength to use for the LLM
func (*HuggingFace) WithMode ¶ added in v0.0.9
func (h *HuggingFace) WithMode(mode Mode) *HuggingFace
WithMode sets the mode to use for the LLM
func (*HuggingFace) WithModel ¶ added in v0.0.9
func (h *HuggingFace) WithModel(model string) *HuggingFace
WithModel sets the model to use for the LLM
func (*HuggingFace) WithTemperature ¶ added in v0.0.9
func (h *HuggingFace) WithTemperature(temperature float32) *HuggingFace
WithTemperature sets the temperature to use for the LLM
func (*HuggingFace) WithToken ¶ added in v0.0.9
func (h *HuggingFace) WithToken(token string) *HuggingFace
WithToken sets the API key to use for the LLM
func (*HuggingFace) WithTopK ¶ added in v0.0.9
func (h *HuggingFace) WithTopK(topK int) *HuggingFace
WithTopK sets the topK to use for the LLM
func (*HuggingFace) WithTopP ¶ added in v0.0.9
func (h *HuggingFace) WithTopP(topP float32) *HuggingFace
WithTopP sets the topP to use for the LLM
func (*HuggingFace) WithVerbose ¶ added in v0.0.9
func (h *HuggingFace) WithVerbose(verbose bool) *HuggingFace
WithVerbose sets the verbose flag to use for the LLM
Click to show internal directories.
Click to hide internal directories.