Skip to content

Commit

Permalink
fix: Better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
macie committed Jan 1, 2024
1 parent 893bb83 commit 81a5246
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llama/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (s *Server) Start(ctx context.Context, modelPath string) error {
return fmt.Errorf("cannot start a LLM server: server not found at '%s': %w", s.Path, errServer)
}
if f.IsDir() {
return fmt.Errorf("cannot start a LLM server: server path '%s' is a directory", modelPath)
return fmt.Errorf("cannot start a LLM server: server path '%s' is a directory", s.Path)
}

f, err := os.Stat(modelPath)
Expand All @@ -68,7 +68,7 @@ func (s *Server) Start(ctx context.Context, modelPath string) error {
}

if s.Logger == nil {
s.Logger = slog.New(boludo.UnstructuredHandler{Prefix: "[llm-server]", Level: slog.LevelInfo})
s.Logger = slog.New(boludo.UnstructuredHandler{Prefix: "[llm-server]", Level: slog.LevelDebug})
}

if s.Addr == "" {
Expand Down Expand Up @@ -109,7 +109,7 @@ func (s *Server) Start(ctx context.Context, modelPath string) error {
i := 1
for {
if ctx.Err() != nil {
return ctx.Err()
return fmt.Errorf("cannot start a LLM server: %w", ctx.Err())
}
if ok := s.Ping(); ok {
break
Expand Down

0 comments on commit 81a5246

Please sign in to comment.