Skip to content

Commit

Permalink
Add set model
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Jul 7, 2023
1 parent 969b1f1 commit 900fe46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions huggingface.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func NewInferenceClient(token string, optFns ...func(o *InferenceClientOptions))
}
}

func (ic *InferenceClient) SetModel(model string) {
ic.opts.Model = model
}

// post sends a POST request to the specified model and task with the provided payload.
// It returns the response body or an error if the request fails.
func (ic *InferenceClient) post(ctx context.Context, model, task string, payload any) ([]byte, error) {
Expand Down

0 comments on commit 900fe46

Please sign in to comment.