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
e8a66680
Unverified
Commit
e8a66680
authored
Jul 26, 2024
by
Daniel Hiltgen
Committed by
GitHub
Jul 26, 2024
Browse files
Merge pull request #5705 from dhiltgen/win_errormode
Enable windows error dialog for subprocess
parents
079b2c3b
e12fff88
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
2 deletions
+32
-2
llm/ext_server/server.cpp
llm/ext_server/server.cpp
+4
-0
llm/llm_darwin_amd64.go
llm/llm_darwin_amd64.go
+3
-0
llm/llm_darwin_arm64.go
llm/llm_darwin_arm64.go
+3
-0
llm/llm_linux.go
llm/llm_linux.go
+6
-1
llm/llm_windows.go
llm/llm_windows.go
+15
-1
llm/server.go
llm/server.go
+1
-0
No files found.
llm/ext_server/server.cpp
View file @
e8a66680
...
...
@@ -41,6 +41,7 @@
#if defined(_WIN32)
#include <windows.h>
#include <errhandlingapi.h>
#endif
#include <cstddef>
...
...
@@ -2737,6 +2738,9 @@ int wmain(int argc, wchar_t **wargv) {
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
argv
[
i
]
=
wchar_to_char
(
wargv
[
i
]);
}
// Adjust error mode to avoid error dialog after we start.
SetErrorMode
(
SEM_FAILCRITICALERRORS
);
#else
int
main
(
int
argc
,
char
**
argv
)
{
#endif
...
...
llm/llm_darwin_amd64.go
View file @
e8a66680
...
...
@@ -2,7 +2,10 @@ package llm
import
(
"embed"
"syscall"
)
//go:embed build/darwin/x86_64/*/bin/*
var
libEmbed
embed
.
FS
var
LlamaServerSysProcAttr
=
&
syscall
.
SysProcAttr
{}
llm/llm_darwin_arm64.go
View file @
e8a66680
...
...
@@ -2,7 +2,10 @@ package llm
import
(
"embed"
"syscall"
)
//go:embed build/darwin/arm64/*/bin/*
var
libEmbed
embed
.
FS
var
LlamaServerSysProcAttr
=
&
syscall
.
SysProcAttr
{}
llm/llm_linux.go
View file @
e8a66680
package
llm
import
"embed"
import
(
"embed"
"syscall"
)
//go:embed build/linux/*/*/bin/*
var
libEmbed
embed
.
FS
var
LlamaServerSysProcAttr
=
&
syscall
.
SysProcAttr
{}
llm/llm_windows.go
View file @
e8a66680
package
llm
import
"embed"
import
(
"embed"
"syscall"
)
// unused on windows
var
libEmbed
embed
.
FS
const
CREATE_DEFAULT_ERROR_MODE
=
0x04000000
var
LlamaServerSysProcAttr
=
&
syscall
.
SysProcAttr
{
// Wire up the default error handling logic If for some reason a DLL is
// missing in the path this will pop up a GUI Dialog explaining the fault so
// the user can either fix their PATH, or report a bug. Without this
// setting, the process exits immediately with a generic exit status but no
// way to (easily) figure out what the actual missing DLL was.
CreationFlags
:
CREATE_DEFAULT_ERROR_MODE
,
}
llm/server.go
View file @
e8a66680
...
...
@@ -346,6 +346,7 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
s
.
cmd
.
Env
=
os
.
Environ
()
s
.
cmd
.
Stdout
=
os
.
Stdout
s
.
cmd
.
Stderr
=
s
.
status
s
.
cmd
.
SysProcAttr
=
LlamaServerSysProcAttr
envWorkarounds
:=
[][
2
]
string
{}
for
_
,
gpu
:=
range
gpus
{
...
...
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