null truncate
This commit is contained in:
parent
c457628090
commit
d05fc26570
|
|
@ -382,7 +382,7 @@ type EmbedRequest struct {
|
|||
// this request.
|
||||
KeepAlive *Duration `json:"keep_alive,omitempty"`
|
||||
|
||||
Truncate *bool `json:"truncate,omitempty"`
|
||||
Truncate types.Null[bool] `json:"truncate,omitempty"`
|
||||
|
||||
// Options lists model-specific options.
|
||||
Options map[string]any `json:"options"`
|
||||
|
|
|
|||
|
|
@ -487,12 +487,6 @@ func (s *Server) EmbedHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
truncate := true
|
||||
|
||||
if req.Truncate != nil && !*req.Truncate {
|
||||
truncate = false
|
||||
}
|
||||
|
||||
var input []string
|
||||
|
||||
switch i := req.Input.(type) {
|
||||
|
|
@ -541,6 +535,7 @@ func (s *Server) EmbedHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
var count int
|
||||
truncate := req.Truncate.Value(true)
|
||||
for i, s := range input {
|
||||
tokens, err := r.Tokenize(c.Request.Context(), s)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue