mirror of
https://github.com/ollama/ollama.git
synced 2025-11-11 18:07:11 +01:00
server: add webp image input support (#10653)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"image"
|
||||
"io"
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
@@ -25,6 +26,7 @@ import (
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
"golang.org/x/image/webp"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/ollama/ollama/api"
|
||||
@@ -1304,6 +1306,10 @@ func Serve(ln net.Listener) error {
|
||||
|
||||
s.sched.Run(schedCtx)
|
||||
|
||||
// register the experimental webp decoder
|
||||
// so webp images can be used in multimodal inputs
|
||||
image.RegisterFormat("webp", "RIFF????WEBP", webp.Decode, webp.DecodeConfig)
|
||||
|
||||
// At startup we retrieve GPU information so we can get log messages before loading a model
|
||||
// This will log warnings to the log in case we have problems with detected GPUs
|
||||
gpus := discover.GetGPUInfo()
|
||||
|
||||
Reference in New Issue
Block a user