package main import ( "errors" "flag" "fmt" "image" "io" "log/slog" "os" "path/filepath" "strings" "time" "github.com/ollama/ollama/cache" "github.com/ollama/ollama/ml" "github.com/ollama/ollama/model" _ "github.com/ollama/ollama/model/llama" _ "github.com/ollama/ollama/model/mllama" "github.com/ollama/ollama/sample" ) var args struct { n int debug bool image string cache bool } func temp() error { start := time.Now() flag.IntVar(&args.n, "n", 10, "number of samples") flag.BoolVar(&args.debug, "debug", false, "enable debug logging") flag.StringVar(&args.image, "image", "", "path to image file") flag.BoolVar(&args.cache, "cache", false, "enable KV cache") flag.Parse() var prompt string if n := len(flag.Args()); n == 1 { bts, err := io.ReadAll(os.Stdin) if err != nil { return err } prompt = string(bts) } else if n > 1 { prompt = strings.Join(flag.Args()[1:], " ") } else { return fmt.Errorf("usage: %s path/to/file