fix build errors

This commit is contained in:
Bruce MacDonald 2023-08-09 10:45:57 -04:00
parent 7a5f3616fd
commit 09d8bf6730
2 changed files with 3 additions and 3 deletions

View file

@ -416,7 +416,7 @@ func (llm *LLM) Embedding(input string) ([]float64, error) {
return nil, errors.New("llama: embedding not enabled") return nil, errors.New("llama: embedding not enabled")
} }
tokens := llm.tokenize(input) tokens := llm.Encode(input)
if tokens == nil { if tokens == nil {
return nil, errors.New("llama: tokenize embedding") return nil, errors.New("llama: tokenize embedding")
} }

View file

@ -87,13 +87,13 @@ func GenerateHandler(c *gin.Context) {
} }
if opts.NumKeep < 0 { if opts.NumKeep < 0 {
promptWithSystem, err := model.Prompt(api.GenerateRequest{}) promptWithSystem, err := model.Prompt(api.GenerateRequest{}, "")
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return return
} }
promptNoSystem, err := model.Prompt(api.GenerateRequest{Context: []int{0}}) promptNoSystem, err := model.Prompt(api.GenerateRequest{Context: []int{0}}, "")
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return return