jmorganca 10 months ago
parent
commit
2abf81885d
2 changed files with 5 additions and 2 deletions
  1. 1 1
      llama/llama.go
  2. 4 1
      llama/runner/runner.go

+ 1 - 1
llama/llama.go

@@ -302,7 +302,7 @@ func (m *Model) Tokenize(text string, addSpecial bool, parseSpecial bool) ([]int
 	}
 
 	tokens := make([]int, result)
-	for i := 0; i < int(result); i++ {
+	for i := range result {
 		tokens[i] = int(cTokens[i])
 	}
 

+ 4 - 1
llama/runner/runner.go

@@ -441,7 +441,10 @@ func main() {
 	server.model = llama.LoadModelFromFile(*mpath, params)
 
 	if *lpath != "" {
-		server.model.ApplyLoraFromFile(*lpath, 1.0, "", *threads)
+		err := server.model.ApplyLoraFromFile(*lpath, 1.0, "", *threads)
+		if err != nil {
+			panic(err)
+		}
 	}
 
 	ctxParams := llama.NewContextParams(*numCtx, *threads, *flashAttention)