Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
8f827641
Unverified
Commit
8f827641
authored
Aug 22, 2023
by
Michael Yang
Committed by
GitHub
Aug 22, 2023
Browse files
Merge pull request #397 from jmorganca/mxyng/release-mode
build release mode
parents
9ec7e375
95187d7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
scripts/build_darwin.sh
scripts/build_darwin.sh
+1
-0
server/routes.go
server/routes.go
+14
-0
No files found.
scripts/build_darwin.sh
View file @
8f827641
...
@@ -3,6 +3,7 @@
...
@@ -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
...
...
server/routes.go
View file @
8f827641
...
@@ -25,6 +25,20 @@ import (
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment