瀏覽代碼

runner.go: Use correct index when retrieving embedding results

This doesn't have any impact currently because NUM_PARALLEL is forced
to 1 for embeddings, so both indicies will always be 0.
Jesse Gross 5 月之前
父節點
當前提交
5f68fcab12
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      llama/runner/runner.go

+ 1 - 1
llama/runner/runner.go

@@ -454,7 +454,7 @@ func (s *Server) processBatch(tokenBatch *llama.Batch, embedBatch *llama.Batch)
 
 		// if done processing the prompt, generate an embedding and return
 		if seq.embeddingOnly {
-			embed := s.lc.GetEmbeddingsSeq(i)
+			embed := s.lc.GetEmbeddingsSeq(seq.cache.Id)
 			if embed == nil {
 				embed = s.lc.GetEmbeddingsIth(seq.iBatch)
 			}