소스 검색

Report errors on server lookup instead of path lookup failure

Daniel Hiltgen 1 년 전
부모
커밋
8711d03df7
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      llm/server.go

+ 6 - 0
llm/server.go

@@ -253,6 +253,12 @@ func NewLlamaServer(model string, adapters, projectors []string, opts api.Option
 	var finalErr error
 	for i := 0; i < len(servers); i++ {
 		dir := availableServers[servers[i]]
+		if dir == "" {
+			// Shouldn't happen
+			finalErr = fmt.Errorf("[%d] server %s not listed in available servers %v", i, servers[i], availableServers)
+			slog.Error("sever list inconsistent", "error", finalErr)
+			continue
+		}
 
 		// Find an availableServers  port, retry on each iterration in case the failure was a port conflict race
 		port := 0