Roy Han 10 місяців тому
батько
коміт
9c32b6b9ed
2 змінених файлів з 1 додано та 20 видалено
  1. 0 19
      docs/api.md
  2. 1 1
      server/routes.go

+ 0 - 19
docs/api.md

@@ -996,25 +996,6 @@ If `stream` is set to `false`, then the response is a single JSON object:
 { "status": "success" }
 { "status": "success" }
 ```
 ```
 
 
-```shell
-POST /api/embed
-```
-
-# Parameters
-- `model`
-- `input`: string or array of strings
-  - cap on string size and array size
-
-# Response
-- `embeddings`: array of embeddings (array of floats)
-  - normalized? definitely normalize for openai
-
-  - truncate flag defaults true, otherwise false if doesn't fit
-
-- deprecate /api/embeddings later
-
-
-
 ## Generate Embeddings
 ## Generate Embeddings
 
 
 ```shell
 ```shell

+ 1 - 1
server/routes.go

@@ -402,7 +402,7 @@ func (s *Server) EmbedHandler(c *gin.Context) {
 		}
 		}
 
 
 		if len(tokens) > opts.NumCtx {
 		if len(tokens) > opts.NumCtx {
-			tokens = tokens[len(tokens)-opts.NumCtx:]
+			tokens = tokens[:opts.NumCtx]
 			return runner.llama.Detokenize(c.Request.Context(), tokens)
 			return runner.llama.Detokenize(c.Request.Context(), tokens)
 		}
 		}