Merge pull request #397 from jmorganca/mxyng/release-mode
build release mode
This commit is contained in:
commit
8f827641b0
2 changed files with 15 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
|
||||||
GO_LDFLAGS="-X github.com/jmorganca/ollama/version.Version=$VERSION"
|
GO_LDFLAGS="-X github.com/jmorganca/ollama/version.Version=$VERSION"
|
||||||
|
GO_LDFLAGS="$GO_LDFLAGS -X github.com/jmorganca/ollama/server.mode=release"
|
||||||
|
|
||||||
# build universal binary
|
# build universal binary
|
||||||
CGO_ENABLED=1 GOARCH=arm64 go build -ldflags "$GO_LDFLAGS" -o dist/ollama-darwin-arm64
|
CGO_ENABLED=1 GOARCH=arm64 go build -ldflags "$GO_LDFLAGS" -o dist/ollama-darwin-arm64
|
||||||
|
|
|
@ -25,6 +25,20 @@ import (
|
||||||
"github.com/jmorganca/ollama/vector"
|
"github.com/jmorganca/ollama/vector"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var mode string = gin.DebugMode
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
switch mode {
|
||||||
|
case gin.DebugMode:
|
||||||
|
case gin.ReleaseMode:
|
||||||
|
case gin.TestMode:
|
||||||
|
default:
|
||||||
|
mode = gin.DebugMode
|
||||||
|
}
|
||||||
|
|
||||||
|
gin.SetMode(mode)
|
||||||
|
}
|
||||||
|
|
||||||
var loaded struct {
|
var loaded struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue