"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "7c823c2ed72aed5dc0db24f368a3663302e71177"
Unverified Commit bd6d741d authored by Bruce MacDonald's avatar Bruce MacDonald Committed by GitHub
Browse files

tell users to check the server error logs

parents 8b1e7918 d1c098b0
...@@ -275,6 +275,18 @@ func generate(cmd *cobra.Command, model, prompt string) error { ...@@ -275,6 +275,18 @@ func generate(cmd *cobra.Command, model, prompt string) error {
} }
if err := client.Generate(context.Background(), &request, fn); err != nil { if err := client.Generate(context.Background(), &request, fn); err != nil {
if strings.Contains(err.Error(), "failed to load model") {
// tell the user to check the server log, if it exists locally
home, nestedErr := os.UserHomeDir()
if nestedErr != nil {
// return the original error
return err
}
logPath := filepath.Join(home, ".ollama", "logs", "server.log")
if _, nestedErr := os.Stat(logPath); nestedErr == nil {
err = fmt.Errorf("%w\nFor more details, check the error logs at %s", err, logPath)
}
}
return err return err
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment